Google Analytics for iOS tracks multiple accounts for a single event

I have two different web resource identifiers from two different accounts, for example UA-1111-11, UA-2222-22 Now, in my iOS application, I need to log in to both of them in events. Is it possible? If not, is there a workaround?

Here is my high-level scenario: I have an existing application where I use google analytics UA-1111-11 for tracking. Now I had an agreement with company X (they have UA-2222-22). They told me that I need to send analytics tracking events to my account (UA-2222-22) from my application (and I want to save UA-1111-11 for my own use).

+8
ios google-analytics-api
source share
2 answers

Google is working on a v2 SDK for iOS and Android, and they have added a feature for several trackers in one application. You can currently download Google Analytics v2 beta 3 for iOS and start playing with it .

+1
source share

Check the Google Analytics SDK

Code example:

#import "RootViewController.h" #import "GAI.h" @interface RootViewController () @end @implementation RootViewController { - (void)viewDidLoad { [super viewDidLoad]; // Send a screen view to the first property. id tracker1 = [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXX-Y"]; [tracker1 sendView:@"/HomeScreen"]; // Send another screen view to the second property. id tracker2 = [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXX-Z"]; [tracker2 sendView:@"Home"]; } @end 

Keep in mind that automatic measurement features, such as automatic screens and uncaught exceptions, will only use one tracker to send data to Google Analytics. If you use these functions and want to send data using other trackers, you will need to do this manually.

0
source share

All Articles