Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
oiluj0002
Frequent Visitor

"We found an unexpected character in the JSON input" error in getting data from google analytics

I need help!

 

When I need to import some Data from google analytics API in Power BI I get that error and can't import data anymore at least for hours. It is related to the data inside GA4 or another thing?

 

Captura de tela 2023-12-12 090739.pngCaptura de tela 2023-12-12 091523.png

13 REPLIES 13
ReportMaster
Helper V
Helper V

Hi @oiluj0002 Seems like the 2.0 beta connector is still presenting some issues. As a workaround, maybe you can try to test your connection with a 3rd party tool. I've tried windsor.ai, supemetrics and funnel.io. I stayed with windsor because it is much cheaper so just to let you know other options. In case you wonder, to make the connection first search for the GA4 connector in the data sources list:

 

GA4-1.png

 

After that, just grant access to your GA4 account using your credentials, then on preview and destination page you will see a preview of your GA4 fields:

 

GA4-2.png

 

There just select the fields you need. Finally, just select PBI as your data destination and finally just copy and paste the url on PBI --> Get Data --> Web --> Paste the url. 

 

SELECT_DESTINATION_NEW.png

WinnieZhang
New Member

I got exactly same problem since this morning. It worked all good before.

 

I have 3 queries connected to GA4, the one is 500+ rows, one is around 6,000 rows, the other one might have lot more rows but I added Group process to summarise it into 200+ rows. 

 

All 3 queries didn't work this morning, showing the same error. I tried to create a new file and connect to GA4, got 50% chance to be able to successfully display the GA4 cubes. But once I switch back to the original file, I got 100% chance failed to get any data. 

 

I don't think there is anything to do with the JSON syntax, because they had been working well before this morning for a few months, and I didn't change the queries at all. Someone reckoned that was the data amount issue, but my dataset is only 500+ rows. Not sure what was changed over night. 

 

My Power BI desktop version is 2.124.2028.0 64-bit (December 2023)

I think you might find if you leave it a while even with the original file and then try again it will work - especially if you disable loading of the larger ones and just try to enable them one at a time. I have a suspicion that we are hitting the API rate limit and it is returning an error which includes the unexpected character. This is a thread about a different issue (but which has also affected me at the same time as this) that I think is probably the cause of both problems:

Stuck at Evaluating Data for Google Analytics : r/PowerBI (reddit.com)

Yes, you make sense. My case was a bit different to the Reddit post discribed. My query had passed evaluating step, it stuck at the step of waiting for google analytics to respond. But yes, I agree it is very likely because the free API found the rate limit was reached. As the same queries started working since I filtered the date into a shorter range. It's annoy because sometimes I need to do the Y-o-Y comparison, if the data is too big, I wouldn't be able to download the rolling 12 months data. But, it is what it is....

Yeah it's very hard to work with that's for sure. Hopefully it is something they will sort out at some point.

aria233
Frequent Visitor

omg! I'm getting same error using 1.0, the connector to UA. It worked just fine this afternoon but not it fails every time now... Have you fixed that? or it just fixed itself later?? it's so annoying :(......

SRW
Regular Visitor

I am also facing this issue. I am using 2.0(Beta) connector. Some times data get refreshed but some times this error occures. I am taking data from different properities, all other properities are refreshing properly. But this is the problem with only one property having most Traffic.  Is it the issue with GA4 connector or the data that google analytics sending ?Can someone please take this issue on priority?

MongooseGeneral
Frequent Visitor

I have got around it for my situation and it involved massively reducing the amount of data being requested in each query. It was only failing on the request for daily page views by country for the last quarter, not other requests involving less data. I resolved it by only pulling the past month's worth of data (so I now have to add in historical data to a spreadsheet each month), and splitting that into multiple (6) queries so that each request only asks for 5 days at a time. Obviously they all still run concurrently but it doesn't seem to cause the error.

Ridiculous but it did the job for me. I would suggest anyone else stuck tries choosing the transform option and heavily filtering the data straight away to see if that loads it.

ErikSmithBPS
Frequent Visitor

This is maddening. It's only happening with one GA4 property for me, which is odd, but it's the one with the most traffic. All the other GA4 properties are refreshing just fine. I've spent hours trying to fix this, and am now stuck until something gets resolved. Hurry up and wait...

andrew_796
Helper I
Helper I

I am having the same issue. I am using the Implementation 2.0 (Beta). Waiting on a solution or fix.  

Syndicate_Admin
Administrator
Administrator

Hello, did you find some workaround for this issue? Thank you

Not exactly. Magically the GA4 api worked, i think it's a problem with connection between GA4 and PowerBI

MongooseGeneral
Frequent Visitor

I've been getting this too to the point where I can't refresh the data anymore so must be an issue with the connector / PowerBI. I meant to post about it but was hoping it would resolve itself.

 

It seems like it can process a certain amount but then I get the error and from then on it just fails instantly for all GA4 sources for a period. Glad to know it's not just me.

 

I do have GA4 data in other reports that is refreshing OK, so I wonder if it's due to the amount going through. I might try heavily filtering the data once it lets me to see if that helps. I've been having the problem for at least 2 weeks, probably longer I think.

 

Hopefully someone else knows more.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors