Google Analytics Connector asset not working


(Ryan Archer) #1

Have attempted to connect Google Analytics account via the Squiz Google Analytics Connector asset and having some trouble with it. I believe I have set it up all correctly in the developers console as per the instructions on the Squiz Guide but when I get to the step of authorising the connector by previewing the page, I get a 400 error page and cannot go any further.

 

If I copy and paste the connector's URL into a separate tab/window, I have google asking for permission to access the page through the API but then the page goes completely white. This process repeats if I refresh the page.

 

So for some reason, I cannot get this service to be authorised. I have attached a screenshot of the 400 error page that I receive.

 

Has anyone managed to set this up successfully? error-400.jpg (36.8 KB)


(Marcus Fong) #2

https://manuals.matrix.squizsuite.net/google-analytics/examples/setting-up-google-analytics says:

"When configuring your project, please ensure the following:

  • The Analytics API has been enabled on the APIs screen.

  • You have created a new OAuth Client ID of type Web Application on the Credentials screen, inputting the root URL of your system in the ‘Authorized JavaScript Origins’ field and the URL of your Google Analytics Connector in the ‘Authorized redirect URI’ field."


    Are you sure you’ve added http://www.slq.qld.gov.au/slq-google-analytics-connector as an authorised redirect URI?

(Ryan Archer) #3

Yes, I have made sure to enable the Analytics API on the dev console.

 

I have also created the new OAuth Client ID of type Web application and inserted the correct information.

 

I have added a bunch of screenshots to this reply as evidence.

 

I can't find any obvious problems in the setup, I've followed the instructions very carefully. Maybe you might be able to spot an issue via the attached screenshots? screen1.jpg (49.5 KB) screen2.jpg (59.9 KB) screen3.jpg (69.2 KB) screen4.jpg (92 KB)


(Marcus Fong) #4

Hmm. Your authorised redirect URI in the Google Developer’s Console doesn’t have a trailing slash, while the redirect URI in the error message does.

Could you change one of them so that they match absolutely exactly, and then try again?


(Ryan Archer) #5

Wow! That seemed to do the trick! The trailing forward slash had never occured to me.

Thanks for your assistance.


(Ryan Archer) #6

Unfortunately hit another speed bump. I am now connected to GA but I get many error messages and no stats appearing in the view now and also an error message when I try to view the stats through Edit+ (I've already modified the config.js file as per the instructions).

 

Our GA account is setup to track multiple websites from the slq.qld.gov.au domain. Not sure if the problem lies in the way the website domains have been setup or the GA account. Have attached screenshots of the error messages below. Squiz Matrix v5.3.0.0 Admin Mode.png (351 KB) editPlus-error-msg.png (98.8 KB)


(Ryan Archer) #7

I just went back and visited the GA asset view today and it seems to work! I think the error was thrown because the connection was new and there was no data to pass over yet from Google.


(Luke Wright) #8

I just went back and visited the GA asset view today and it seems to work! I think the error was thrown because the connection was new and there was no data to pass over yet from Google.

 

Hi there,

 

Good to hear things are working properly now.

 

For future reference, we don't automatically generate the first set of Admin Mode data - doing that works like a Report asset: you acquire the lock, request that the report be generated, then commit. We do this because gathering the data from Google Analytics isn't a trivial process - it can take about five to ten minutes on average, depending on how many goals and content experiments you are tracking.

 

Alternatively, the Analytics data is set to automatically refresh in a daily scheduled job, which is set for 04:00 server time. So if you don't manually generate the report, it will generate overnight. We don't do it more often because Google Analytics' API has a set daily maximum number of queries, and also because Google only guarantees 24-hour freshness unless you pay for Google Analytics Premium - especially on larger data sets (>1 million page views per month).

 

That doesn't excuse the set of errors you're getting on the Admin Mode screens, but that's why there was no data to begin with.

 

Hope this explains things for you for when you (or others) deal with the GA Connector in future.

 

~ Luke