How to interpret and resolve the “Invalid Grant” error for Google Data Sources
THE “INVALID GRANT” ERROR MAY BE RETURNED FOR THE FOLLOWING REASONS
- The user has revoked your access.
- The refresh token has not been used for six months
- The user changed passwords and the refresh token contains Gmail scopes
- The user has exceeded the maximum number of granted (live) refresh tokens
The user revoked your access
HOW TO
- Interpret the error
- Resolve the error
How to interpret this error
This happens when the user that connected the Google Data Source in Lucrative has their permissions changed or revoked to the Google Account. Since Lucrative gains access to your Google data through this user, it is imperative that they have the necessary permissions.
How to resolve this error
Contact an Admin in your Google Account to restore your original user permissions. Once that’s complete, navigate to the Data Manager and click the Reconnect button to reconnect your Google Data Source.
The user changed passwords and the refresh token contains Gmail scopes
HOW TO
- Interpret the error
- Resolve the error
How to interpret this error
This happens when the user that connected the Google Data Source in Lucrative changes their Google password. Since Lucrative gains access to your Google data through this user’s credentials, it is imperative that they are up-to-date.
How to resolve this error
Navigate to the Data Manager and click the Reconnect button to reconnect your Google Data Source with your updated credentials.
The user has exceeded the maximum number of granted (live) refresh tokens
This is the most common reason why the “Invalid Grant” error is returned from Google Analytics.
HOW TO
- Interpret the error
- Resolve the error
How to interpret this error
This happens when a single Google user connects more than 50 Google Accounts. “Google Accounts” includes any Google application (Google Analytics, Google Ads, Google Search Console, etc.). The 50 Google connection limit includes any Google Data Sources connected in Lucrative and any Google connections in other applications. Once the 51st connection is initiated, the user’s connection limit is exceeded. When this happens, the oldest Google connection (i.e., the 1st connection by the user) is automatically disconnected. If the same user connects a 52nd Google Account, the 2nd connection they made will automatically become disconnected as well. This will continue in order to ensure that a single Google user only has a maximum of 50 active Google connections at any given time.
How to resolve this error
In order to resolve this error and prevent future occurrences, you’ll need to limit the number of connections that each Google user makes. If needed, you can create additional users in Google and use those to add more Google connections.For example, you may make it part of your process to create a new Google user for every 35 connections. (this will give you some margin for error). Once you’ve established 35 connections with that Google user, you can create a new user and continue adding connections.