Google Analytics Data not populating

Thanks. I had the same issue, but this was the solution.

In case it helps someone, I think the confusion comes from the term “account”. Until now, I thought that “account” was referring to my Google account, but in fact, it refers to a Google Analytics Account. Under your Google account, you can have several Analytics accounts, each with several properties. See the screenshot below:

I believe the key is to have one service account per Analytics account. In my case, one service account is able to pick all properties inside that Analytics account. But if you have more than one Analytics account under your Google Account, then you need to create 1 service account per Analytics account.
It’s a little confusing to understand at first because of the similar naming, but once you get it, it works.

1 Like

I seem to be having the same issue. I’m using one JSON file and one service account. MainWP Google Analytics appears to only allow one service account. If I create a new JSON file/key and upload it, it replaces the existing one. All of my sites can be connected under the settings menu but when I go to view Visitor Data, only one of my sites is showing data. Did you get this resolved?

1 Like

I tried that too. It doesn’t work. You have to create another service account and json file for that service account. Then link the email address of that service account to ONE analytics property. (And repeat)

1 Like

But it looks like MainWP will allow only one Service account. If I upload a new one it replaces what is already there…

1 Like

@curtis you are correct! You do have to create a new Service account and JSON key and upload it as a new account. that new email needs to be added to a unique GA property. Unfortunate process for having dozens of GA accounts, but it does seem to be working now. Thanks, all!

1 Like

Thank you all for the insight.

We will perform additional testing and verify that having multiple Analytics Accounts in the Google Analytics Dashboard, requires multiple Service Accounts.

We will update this thread with findings and update the documentation as needed.

1 Like

That does not work for clients. Each client has their own account for their analytics. Some I created and manage and some they created and manage on their own.

No, I have not. The issue seems to be stemming from the fact that this will only access one account, which can access any of the properties you add the Service Accounts email to, or all of the properties if you add the email to the root account. This does not work across different accounts.

Yes, you’re absolutely right. I was just trying to explain the difference between account vs. property in case it was helpful for anyone.

Clients’ properties are usually under a different account each, so you’ll need a service account per each Analytics account.

The issue comes in that each Service Account requires a different key to be created and MainWP only allows 1 key file to be uploaded. This I feel is not a plausible solution to obtain Google Analytics from each of the client’s accounts.

1 Like

Hello @bojan , I can see all GA accounts but only the last one connected shows data.

I did the following:

  1. Enabled APIs
  2. Created one OAuth
  3. Created one Service account
  4. Uploaded JSON
  5. Added service email to 2 different GA4 accounts (for testing)

Result:

  • I see all my accounts on the dropdown Screenshot by Lightshot
  • When I connected the first account, it received data
  • When I connected the second account, the second received data, but the first one stopped receiving
  • Widget data and report data are also empty in the first account, after I connected the second

We need a solution for this, I have 100 clients and nothing about GA works after the update.
Also we need a clear doc about how to add multiple accounts. One or multiple OAuths? One or multiple Services? What happens if we have 100 properties in 2-3 different GA Master accounts? We have to add them separately?
Please provide clear instructions. Don’t let us guess and try to figure this out on our own.

Originally posted here: New GA4 Extension - #18 by dichagr but it tranfered it in this support topic.

2 Likes

That’s odd. I managed to upload 9 json files. All my sites are getting data.
Have you tried renaming them before uploading?

OH Crap! I didn’t catch that.

I was under the impression that I only needed one Service Account that would access the View data from any GA4 account the email address was attached to. I did realize I needed to create a Service Account for each GA4 account. I also assumed that I was only able to upload just one JSON file.

I’m good to go now. Issue SOLVED!

  • I created a new Service Account email

  • Generated the key in this new Service Account and downloaded the JSON file

  • Uploaded it to MainWP

  • I replaced the first Service Account email address with the new Service Account email address in the second GA4 Analytics account and the data for the second site is pulling in just fine.




1 Like

This is correct.

It is necessary to have a separate Service Account for each Analytics Account you may have in your Dashboard.

But one Service Account can be used as a Viewer for multiple properties within one Analytics Account.

We are in the process of updating our documentation to reflect this.

And we are investigating if it’s possible to streamline this process further.

Thanks Bojan. @angelcandelaria made me aware of this.

There is just one small issue with your screenshot. GA4 PROPERTY does not contain a VIEW tier.

1 Like

Thanks for pointing that out. That was indeed a view for a UA property.
I’ve updated the screenshot.

1 Like

Glad to be of help, @kwsim

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

@kwsim @xtego @webtailors @angelcandelaria @kitzmillercreative2

We believe we’ve identified an issue with the extension which was causing the inability to see the data of the properties of the Analytics Accounts which you are not the owner of.

We’ve prepared a version with a fix for this. In our testing, we can now see the property data of all Analytics Accounts.

This means that creating a separate Service Account for each Analytics Account will no longer be necessary.

Please try it out for yourself, and let us know if it works for you: Dropbox - mainwp-google-analytics-extension.zip - Simplify your life

After you install this version, go to the extension settings, re-save the settings, and refresh data.
If that doesn’t connect all properties, try re-uploading the JSON Key file.

Alongside that, you will have to add the Service Account email (from a single Service Account!) as a Viewer to all properties.

2 Likes