Google Analytics authorization and consent errors


Viewing Site analytics, it will display an unauthorized message:

"You are not currently authorized to view the data. Ensure you have correctly set up the Google Analytics Connector and that the DNN Google Analytics application is still authorized on your Google Account settings."

Or, alternatively:

Error: User must consent Google Analytics access first

These errors prevent the use of Google Analytics.



This error is most frequently reported in DNN Evoq version 9.1.1 after a migration or upgrade.

To solve this issue, you will need:

  • Access to a SuperUser account.
  • Access to SQL console or SQL Server.
  • Database backup



1. Make sure that Google Analytics has been set up, follow the KB: integrate Google Analytics with DNN. This is the service that the site analytics section uses. 

If you have already set up Google Analytics previously, move to the following steps.

NOTE: Always take a database backup before running SQL queries. 

1. Go to Persona Bar > Settings > SQL Console.


2. Execute the following query to find the PortalID of the affected instance:

SELECT portalid from portalalias where httpalias = 'YOUR_WEBSITE_ADDRESS_HERE'

NOTE: In the above query, do not use http or https in your website address. 

3. Once you have the PortalID, disable the analytics microservice by executing the following:

UPDATE PortalSettings SET SettingValue = 'False' WHERE SettingName = 'AnalyticsEnabled' AND PortalID = ENTER_PORTAL_ID_HERE

4. Execute the following to delete the remaining analytics details in the portal:

DELETE FROM PortalSettings WHERE SettingName IN ('AnalyticsAccountCode','AnalyticsClientCredentials') AND PortalID = ENTER_PORTAL_ID_HERE

5. Clear your cache.

6. Go to Persona Bar > Dashboard > Site Analytics and enable the Analytics when you receive the Enable prompt.




Validate that Analytics is now working by going to Persona Bar > Dashboard > Site Analytics. If successful, you will see the data as intended. 




Please sign in to leave a comment.