Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8854925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:59:54+00:00 2026-06-14T13:59:54+00:00

After following the overview found here: https://developers.google.com/analytics/devguides/collection/ios/v2/ I am seeing an Unused variable tracker

  • 0

After following the overview found here:

https://developers.google.com/analytics/devguides/collection/ios/v2/

I am seeing an Unused variable "tracker" warning on the last line of the code added to:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

Here’s the code from Google’s overview page:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  // Optional: automatically track uncaught exceptions with Google Analytics.
  [GAI sharedInstance].trackUncaughtExceptions = YES;
  // Optional: set Google Analytics dispatch interval to e.g. 20 seconds.
  [GAI sharedInstance].dispatchInterval = 20;
  // Optional: set debug to YES for extra debugging information.
  [GAI sharedInstance].debug = YES;
  // Create tracker instance.
  id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-YOUR-TRACKING-ID"];

}

tracker truly sees absolutely no use past this point and the overview document doesn’t really say what to do with it. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:59:56+00:00Added an answer on June 14, 2026 at 1:59 pm

    If you don’t need a reference to your tracker (and it looks like you don’t) you can remove the warning by changing the last line of code from

    id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-YOUR-TRACKING-ID"];
    

    to

    [[GAI sharedInstance] trackerWithTrackingId:@"UA-YOUR-TRACKING-ID"];
    

    A use case for keeping a reference to the tracker in this block of code could be if you wanted to create an event for when a user starts the application, without having to call [GAI sharedInstance] to get that reference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After following: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview I can sign up a user via Facebook. But I'm struggling
After following these steps: http://developers.facebook.com/docs/mobile/android/build/ I find that everything goes well, but when I
After following successfully the method to set multiple LAUNCHER activities (as described in https://stackoverflow.com/a/3270783/978329
FINAL EDIT: After following the answer from Darin Dimitrov, I have found that the
I've seen some question here about almost the same thing, but, after following their
after following the install instruction here on my Debian system sudo apt-get install ruby1.9.1
After following the great tutorials from http://www.raywenderlich.com/ on how to submit your app to
After following the instructions here How To Implement URL rewriting with UrlRewriter.Net? I'm getting
After following a tutorial on SO I found a way to get GPS to
After following the official tutorial here: tutorial I'm still having issues adding rows/creating a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.