Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Google Analytics - Multiple Instances on iOS?

Discussion in 'Scripting' started by BrodyB, Sep 12, 2015.

  1. BrodyB

    BrodyB

    Joined:
    Dec 17, 2014
    Posts:
    10
    Hey there!

    I'm working on an app where we want to have Google Analytics sending all our analytics information to two different tracking IDs. The best way I've found to achieve this is to have two different instances of the GoogleAnalyticsV3 script on a GameObject and a custom analytics manager script sitting alongside I pass my analytics calls to that will pass them along to each instance.

    For desktop/web player, this works great. When I run the app, we see both analytics accounts light up with activity. However, when I push to iOS, the only tracking ID used is what's set on the last GoogleAnalyticsV3 instance (the lowest instance of it on the GameObject that contains all of them as seen in the Inspector window). So, all I seem to be able to push to on iOS is one tracking ID, period.

    Is this a known behavior and is there a work-around? Or does this not sound right to anyone and I might be doing something wrong? This has really been throwing me for a loop.

    Thanks for any help!
     
  2. danieltranca

    danieltranca

    Joined:
    Jan 9, 2015
    Posts:
    10
    I have the same problem and after some investigation I found that Google is using singleton for iOS(id tracker = [[GAI sharedInstance] defaultTracker];) have you found any workaround this problem?

    Thank you!