I am implementing Google Analytics SDK in my iPhone application. I did it to work with the following code:
AppDelegate meter: [[Gantracker sharedTracker] startTrackerWithAccountID: @ "UA-xxxxxxx-1" dispatchPeriod: 10 Rep: zero]; If ([[Gantra cracker] trackpage view: error with string: & amp; error] {NSLog (@ "An error with Google Analytics Tracking 2,% @" error, error); } And {nslog (@ "ok"); } In my analytics account, I was getting the desired result then I decided (why not ask me) to try to send my tracking data to a 2 Analytics account too. For inquisitive people: An account is used for web page and iPhone app statistics and the other is considered for just iPhone
For my other simple plan, create 1 sharedTracker for sending it , Stop it and it was the same:
AppDelegate h: @interface AppDelegate: NSObject's & lt; UIApplicationDelegate, GantrackerDelegate & gt; // Implementation AppDelegate Meters: // 1 Tracking Account [[Gantracker sharedTracker] startTrackerWithAccountID: @ "UA-xxxxxxx -1" dispatchPeriod: 10 Rep: Self]; If ([[GintraKar shared tracker] trackpage view: error with string: & amp; error] {NSLog (@ "error with Google Analytics tracking,% @", error); } Other {nslog (@ "1. guanalytics: okay"); } [[Guntracker shared tracker] StopTracker]; // Second Tracking Account [[Gentrecker Shared Tracker] startTrackerWithAccountID: @ "UA-zzzzzzzz-1" Remittance Duration: 10 Rep: Self]; If ([[GintraKar shared tracker] trackpage view: error with string: & amp; error] {NSLog (@ "error with Google Analytics tracking,% @", error); } Other {NSLog (@ "2.Ganelitics: OK"); } [[Guntracker shared tracker] StopTracker]; - (zero) trackerDispatchDidComplete: (Guntracker *) on-sight eventsDispatched: (NSUInteger) eventsDispatched eventsFailedDispatch: (NSUInteger) eventsFailedDispatch {NSLog (@ "For Got's love, why do not you say something?"); } I added the sent method to send some clues, and to find out that the SDK is making two separate requests, but it seems that I am representing my representative method Can not apply! By removing the code of the second tracker, I have not even helped to dispatch the transmission period with manual dispatch call 0 (and -1), but I have no luck with this. | So, my questions are: how to do 2 gAnalytics accounts and how to apply your representative method to do this - to be called after the dispatch :)
Thank you in advance, Luke
I posted pageviews, events, etc. on two different Google Analytics accounts. Be able to be able to start with exactly the same requirement. But the problem is in your case that, [Gantracker sharedTracker] is a single item and if you always get the same as an object or an example, you can not actually have two examples of sharedTracker.
In addition, where you are trying to see that call back method is not called, it will not be called because you are calling [[Gartrakkar shared tracker] StopTracker] and let the events happen. Will stop If you comment on that line, call your callback method.
If you look under documents in the app directory, Google Analytics stores all the data in SQLite database which is called googleanalytics.sql. You can open it and see the tables in it. Go to that directory and type "sqlite3 googleanalytics.sql" and if you know about socket lifts, you can navigate to tables and goods. There is no reference to any of the account IDs in the table, so my guess is that, unless you do some very smart quarks, you can not actually post to two different accounts.
Comments
Post a Comment