Forum Discussion

alexvgp's avatar
alexvgp
Regular Visitor
2 years ago

Problem with GA4 2.0 connection

 
Some time ago I connected to GA4 using the Google Analytics 2.0 connector, however, in December it started to present the problem below, and no changes were made to it during the period. What makes it seem even stranger is that in the automatic update, some days it updates, and other days it presents the same problem without making any type of adjustment. Please, can anyone help?

 

Problem presented:
DataFormat.Error: We found an unexpected character in the JSON input.DetailsReason = DataFormat.Error
Value = \31
Position = 0

 

In the advanced editor it looks like this:

 

let
    Fonte = GoogleAnalytics.Accounts([Implementation = "2.0"]),
    #"navegation1" = Fonte{[Id="accounts/9999999"]}[Data],
    #"navegation2" = #"navegation1"{[Id="properties/9999999"]}[Data],
    #"navegation3" = #"navegation2"{[Id="properties/9999999"]}[Data],
    #"Itens Adicionados" = Cube.Transform(#"navegation3",
        {
            {Cube.AddAndExpandDimensionColumn, "transactionId", {"transactionId"}, {"transactionId"}},
            {Cube.AddAndExpandDimensionColumn, "date", {"date"}, {"date"}},
            {Cube.AddAndExpandDimensionColumn, "campaignName", {"campaignName"}, {"campaignName"}},
            {Cube.AddAndExpandDimensionColumn, "medium", {"medium"}, {"medium"}},
            {Cube.AddAndExpandDimensionColumn, "source", {"source"}, {"source"}},
            {Cube.AddMeasureColumn, "totalRevenue", "totalRevenue"}
        })
in
    #"Itens Adicionados"

 

* The IDs have been changed to "9999999". I'm warning you so it doesn't look like it's a mistake.

3 Replies

  • Hi alexvgp As other comment mentioned, using a different connector could work in this case. It seems like the 2.0 beta connector is still presenting some issues. I currently use windsor.ai's GA4 connector and I haven't had any issue or problem so far with my connection or data accuracy. In case you wonder, to make the connection first search for the GA4 connector in the data sources list:

     

     

    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:

     

     

    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. 

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi alexvgp ,

     

    You might want to try the following:
    - Make sure that both Power BI Desktop and the Google Analytics connector are updated to the latest version.
    - Try reducing the amount of data being processed by heavily filtering the data.
    - Try using a different connector or tool to connect to GA4, such as Google BigQuery .

     

    You can refer to the similar posts that may be helpful to you:

     "We found an unexpected character in the JSON ... - Power Platform Community (microsoft.com)

    powerbi - Issues with connecting Google Analytics to Power BI - Stack Overflow

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

  • hands-dw's avatar
    hands-dw
    Regular Visitor

    We have the same issue wich started to appear on Feb. 12th.
    We reported to PowerBI support und hope to get a solution for this.
    It's an issue of the dataflow. In PowerBI Desktop we don't get this error.