It appears to be setup properly as the Analytic properties I have connected to my service account email address are showing in the drop down when I try to link up a site in MainWP. However, after I link a site all the visitor information is showing as zeros despite the fact that there is visitor information in Analytics. I’ve tried this with a couple of different sites and the results are the same. I’ve double checked the setup steps and I believe I have done everything correctly, but perhaps I missed something? What would allow me to connect a site, but not be able to see any data? Any insight would be appreciated.
I’m Having the same issue. Setting up this OAuth & Service Account appears to be working because I am receiving data from one of the 3 sites I connected to MainWP. However, this one site is the only one showing data from the 3 sites I linked to MainWP.
I have added the Service Account email to all 3 GA4 accounts as a viewer, see below and these sites are showing up in the Visitor Data dropdown as well as when I connect the GA4 account to the child site edit.
Below are all the API, GA4, and MainWP screenshots.
Thanks for posting the screen shots. This looks like the same issue I’m experiencing. Can I ask… how are the analytics accounts set up? In other words, are they all owned by separate google accounts and then shared to your agency? In my case, I have a ton of analytics properties that my agency account has access to, (let’s call it [email protected]) but the analytics accounts themselves were originally setup using a client’s google account ([email protected]). The Google cloud api in this case is setup under [email protected]. I’m wondering if that is the problem. It seems odd to me that the API wouldn’t allow for the polling of data from other sites where access has been granted. But I really don’t know how it works.
I think I’ve got this working. After some troubleshooting, I found that when I linked a service account it had a particular property name associated with it. Even though I had 4+ analytics properties associated with the service account, only one name showed under the “manage accounts” section of the ga4 extension. This is the only one getting any visitor data.
I read on another thread that you had to create new oauth credentials under each google cloud account. That seemed pretty tedious… so I tried just creating another service account for each property. This was the ticket.
Just create a service account and JSON key file for each website. Then allow viewer access to that service account email address in analytics. (One per site) Data started showing up immediately.
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.
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?
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)
@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!
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.
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.
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.
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.