1
votes

I need to use Google analytics services in my app (android and ios). I created a project in Google API Console and imported it into Firebase for FCM services. But after that, I cannot link the Google project into Google Analytics and get configuration file. When I try to get configuration file and select app name, it jumps to Firebase console.

If I add Android or iOS in the Firebase project, the configuration file I got doesn't have google analytics info.

Anyone know how to solve this. I need to use Google Analytics in my app but not the Firebase analytics.

4

4 Answers

3
votes

I also need to support both standalone Google Analytics SDK and Firebase Analytics, and I was finally able to find a solution in this Google Analytics Support answer (Analytics for mobile apps).

Google Analytics without Firebase:

  1. Go to Google Analytics > Admin > Create new Property
  2. Select Website, using your app name as Website Name, and optionally your company website as Website URL.
  3. Back up to the Admin page.
  4. For the Property you just created, in the right-most column (View), there should be an "All Website Data" view. Create a new View.
  5. Select Mobile App, naming the view something appropriate, like "All Mobile Data".

Note: Property Settings will now contain a valid GA Tracking ID you'll need for client set-up.

Google Analytics with Firebase:

  1. Create a Firebase project for your app.
  2. Go to Google Analytics > Admin > Create new Property
  3. Select Mobile App, then use the "Link to Firebase" dropdown to connect to the Firebase project you created in Step 1.

Keep in mind that while there is still a standalone, non-Firebase Google Analytics API to support legacy applications, Google is definitely pushing all new application-development over to Firebase APIs. My opinion is that this solution is mainly good for libraries that need to support new & legacy apps, or during a transitional period.

0
votes

Refill and Re-enter your application name in App name field manually, so that you will not have to select the routing to the Firebase option and it will not take you to the firebase console. It's a silly thing by google

0
votes

TO go to enable or disable the api like map , drive and other of google apis from Firebase project go to this link and will see all api , hope this help.

-1
votes

1. If you don't have GoogleAnalytcs library in your project, get it.

You can use cocoapods: pod 'Google/Analytics'.

2. Get Tracking ID from https://analytics.google.com. If you have not created an analytics account yet, you can do it there:

enter image description here

3. Add this Tracking ID to GoogleService-info.plistwith key TRACKING_ID:

enter image description here

4. Configure the app:

// Configure tracker from GoogleService-Info.plist.
var configureError:NSError?
GGLContext.sharedInstance().configureWithError(&configureError)

5. Example - sending screenView:

func sendScreenView(name: String) {
    let tracker:GAITracker = GAI.sharedInstance().defaultTracker as GAITracker
    let build = GAIDictionaryBuilder.createScreenView().set(name, forKey: kGAIScreenName).build() as NSDictionary
    tracker.send(build as [NSObject : AnyObject])
}

Note: Above procedure is for iOS, Android configurations should be similar.