DNN Blogs

Written for the Community, by the Community

NEW - Google Analytics 4 Connector

Written By David Poindexter

Currently there are two Connectors in DNN Platform for quickly configuring analytics scripts. One is the original Google Analytics connector.  In its current state, this works for Universal Analytics properties using the latest recommend script placement. The other is the Google Tag Manager connector.  This one is great for those that prefer to manage everything using a Google Tag Manager container.

A while back Google announced that Universal Analytics is going away.  You can read this article for more details.  The key takeaway is that on July 1, 2023, Google will stop processing data for all Universal Analytics properties.  If you created a Google Analytics property before October 14, 2020, it is most likely a Universal Analytics property.  If created after then, you are most likely using a Google Analytics 4 property.

To learn more about making the switch to Google Analytics 4 (GA4), you can read this article.  As it relates to integration with DNN, we have developed a new Google Analytics 4 connector.  It is planned for inclusion in a DNN 9.12.0 release.  We will be deprecating the Google Analytics connector, as it will no longer be relevant after July 1, 2023.

The new connector is super easy to use and here are a few screenshots to help you prepare.

Click "Connect" for the "GOOGLE ANALYTICS 4" connector.

GA4 Connector Screenshot 1

Enter the "Measurement ID" from your GA4 property data stream.

GA4 Connector Screenshot 2

Click "Save" and you will see a green circle with a white checkmark indicating a "connected" state.

GA4 Connector Screenshot 3

From here, you can go to Settings > Config Manager and select "SiteAnalytics.config".  Here you will see the new AnalyticsEngine added with the recommended script/config from Google for GA4.  This has the [GA4_ID] token in the appropriate places that will be replaced by the Measurement ID entered within the connector. 

By the way, don't worry that you still see the old Google Analytics script for Universal Analytics in the config file.  That will not be injected on the page as long as that connector is not in a "connected" state.


GA4 Connector Screenshot 4

Now you are done and if you inspect the page source.  There you will see the script is injected as expected at the top of the <head> section within the HTML and the [GA4_ID] is replaced with the Measurement ID value.

GA4 Connector Screenshot 5

We hope this new feature serves you well.  DNN Community for the win!

Total: 8 Comment(s)
Excellent content. Thank you for posting it!
Monday, June 12, 2023 ·
You are welcome - just now seeing these comments - evidently notifications aren't being sent to blog authors now. Something else to look into improving. ;-)
Tuesday, June 27, 2023 ·
Cool, thanks :-)
Monday, June 12, 2023 ·
You are most welcome!
Tuesday, June 27, 2023 ·
Awesome Dave! Thank you very much for this.
Monday, June 12, 2023 ·
Absolutely - you are welcome!
Tuesday, June 27, 2023 ·
Great post, David. However, I experienced one issue (possibly due to how the site I manage is configured, but not 100% sure) ...In the DNN site I am managing, updating the SiteAnalytics.config file only added Google Analytics 4 to my landing page, it did not propagate to all pages. In order to propagate GA4 to my other pages I had to add the tag script to the field "HTML Page Header Tags" located in Settings > Site Settings > Site Behavior > Page Output Settings (replace [MEASUREMENT ID] with a valid ID)
Wednesday, October 4, 2023 ·
For clarity, I had to add the "Google Tag" script. (which you can find by logging into Google Analytics) I would copy/paste it here but the DNN community site does not allow code snippets or screenshots.
Wednesday, October 4, 2023 ·

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved