Skip to content
This repository was archived by the owner on Sep 15, 2021. It is now read-only.

Commit f39878b

Browse files
CodingCarlosgortok
authored andcommitted
Add advertising id collection support (to $cordovaGoogleAnalytics) (#1300)
* Add advertising id collection support Add the avaliabilty of enable the Advertising ID Collection using the new function added to the plugin (in danwilson/google-analytics-plugin#252) * Epic fail ; to , fix Yes, shit happen.
1 parent be147c2 commit f39878b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/mocks/googleAnalytics.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ ngCordovaMocks.factory('$cordovaGoogleAnalytics', ['$q', function ($q) {
2626
'setUserId',
2727
'setAppVersion',
2828
'debugMode',
29+
'setAllowIDFACollection',
2930
'trackView',
3031
'addCustomDimension',
3132
'trackEvent',

src/plugins/googleAnalytics.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,20 @@ angular.module('ngCordova.plugins.googleAnalytics', [])
5454
return d.promise;
5555
},
5656

57+
setAllowIDFACollection: function(enable) {
58+
var d = $q.defer();
59+
60+
if(typeof(enable) === 'undefined') {
61+
enable = true;
62+
}
63+
64+
$window.analytics.setAllowIDFACollection(enable, function (response) {
65+
d.resolve(response);
66+
}, function () {
67+
d.reject();
68+
});
69+
},
70+
5771
trackView: function (screenName) {
5872
var d = $q.defer();
5973

0 commit comments

Comments
 (0)