A couple of years ago I wrote about trying Google Analyticator for WordPress. I’m still using that plug-in, but recently I noticed that its dashboard widget wasn’t working. Instead, I was getting the error:
Google Analytics UID: There was an Analytics API service error 400:Error fetching OAuth2 access token, message: ‘invalid_grant’
I found that others were having the same problem. I continued my search and found a post from WordPress forum user rhenderson813 stating that Google Analytics has added a requirement for an authentication code.
I had already upgraded Google Analyticator to the most recent version, so I went to Settings -> Google Analytics in my WordPress admin panel. Rather than display the settings that I expected, I got a page entitled “Activate Google Analyticator”. Here are the steps that I followed.
- Right below the text “You need to sign in to Google and grant this plugin access to your Google Analytics account”, I clicked on the “Click here” link.
- That popped up a window from Google which asked me to log into my Analytics account. I did so.
- Next it displayed “Google Analyticator for WordPress is requesting permission to: View your Google Analytics data”
- I clicked on “Allow Access”.
- The pop-up presented new information that said “Please copy this code, switch to your application and paste it there:”, followed by a field with an alphanumeric code.
- I copied this code, went back to the WordPress dashboard, and pasted it into the blank field next to the “Save & Continue” button.
- I clicked on “Save & Continue”.
Finally the dashboard widget came back to life and I could see the stats from Google Analytics again.