Sitata / titanium-google-analytics

Google analytics for Appcelerator Titanium
MIT License
92 stars 47 forks source link

How can I use Demographics and Interest Reports #71

Open PMistry123 opened 6 years ago

PMistry123 commented 6 years ago

Your Demographics and Interest Reports have been enabled, but your Analytics tracking code does not include the necessary support to show them. The simple, one-line, one-time change to your tracking code to add this support.

How can I add following analytics code with alloy.globals.gaTracker for Android.

App-tracking code change for Android To enable these features for Android, modify your Analytics tracking code to collect the advertising id. Call the enableAdvertisingIdCollection method on the tracker for which you want to enable these features. For example:

// Get tracker. Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker( TrackerName.APP_TRACKER);

// Enable Display Features. t.enableAdvertisingIdCollection(true);


iOS

To enable these features for iOS, collect the IDFA (Identifier for Advertisers). To enable IDFA collection, link the libAdIdAccess.a and AdSupport.framework libraries to your application and set the allowIDFACollection to YES on each tracker that will collect the IDFA. For example:

// Assumes a tracker has already been initialized with a property ID, otherwise // getDefaultTracker returns nil. id tracker = [[GAI sharedInstance] defaultTracker];

// Enable IDFA collection. tracker.allowIDFACollection = YES;

Help would be appreciated!

Thank You