1

I'm trying to get events data from Google Analytics via API. However, I have a problem with running the sample example.

I started with tutorial Hello Analytics API and there were no problems till Step 3: Setup the sample. There is no problem with service account connection. The problem occurs later, when it tries to get profile_id, because there is no any possible profile to use.

File ".../analytics.py", line 61, in get_results
    ids='ga:' + profile_id,
TypeError: can only concatenate str (not "NoneType") to str

I was trying to create some profile in Google Analytics and Firebase pages, but after reviewing all the nooks and crannies I decided to give up, because I couldn't find anything.

In addition I can tell you that the Google Analytics account was set up for Android and iOS app, which were created for university project. So we didn't put app on stores, and we have just Standard account.

Have you met with such a problem? Maybe you have some ideas how to fix that problem?

Qdelix
  • 11
  • 1

1 Answers1

1

no any possible profile to use.

I think you are saying that the service account doesnt have access to any profiles. The error below.

User does not have any Google Analytics account

You need to go to the admin section of the Google analytics website and find the account which contains the profile you want to access. Add the service account email address as a user at the account level. It will then be able to access the data.

enter image description here

Google Analytics and Firebase pages

Remember google analytics is not Firebase analytics you are only going to be able to access google analytics profiles with the google analytics api.

Community
  • 1
  • 1
Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449