Table of Content


Thanks for choosing DNN Google Tag Manager by weweave! DNN Google Tag Manager lets you integrate Google Tag Manager into your DNN portal without any coding by following Google’s best practices.

If nothing else is stated, this documentation refers to the latest available version of DNN Google Tag Manager.


In order to use DNN Google Tag Manager, make sure your environments meets the following requirements:


Please follow these steps to set up DNN Google Tag Manager:

  1. Download DNN Google Tag Manager from the download page.
  2. Log in to your DNN installation as host admin and navigate to “Host > Extensions”.
  3. Select “Install Extension Wizard” and follow the installation process.
  4. After a successful installation you should see two new menu items: “Google Tag Manager under “Admin” and “Host”. The portal-specific configuration can be performed under “Admin > Google Tag Manager”, whereas the global configuration can be performed under “Host > Google Tag Managerd”.
  5. Enter your Google Tag Manager Container ID for each of the affected portals under “Admin > Google Tag Manager”.
  6. Enter your license key under “Admin > Google Tag Manager” and check the “Enable-checkbox”.
  7. Google Tag Manager integration is now enabled automatically.


Please follow these steps to upgrade your existing DNN Google Tag Manager module installation:

  1. Download the latest version of DNN Google Tag Manager for your DNN version from the download page.
  2. Make sure that your license key is still valid before performing the upgrade.
  3. Log in to your DNN installation and go to “Host > Extensions”.
  4. Select “Install Extension Wizard” and follow the process.

Portal Configuration

The actual configuration of DNN Google Tag Manager is performed portal-specific under “Admin > Google Tag Manager”.

Basic Settings

  • Enable: Check to enable the Google Tag Manager integration
  • Container ID: Your portal’s Google Tag Manager container ID
  • Inject in 404 error page: Check to inject the Google Tag Manager snippet to DNN’s 404 error page
  • Inject <noscript> after opening <body>: Check to inject <noscript> tag after opening <body> tag; if unchecked the <noscript> tag is injected before the closing </body> tag (use this option with care as it could result in postback problems which break some functionalities in DNN)
  • Enable data layer: Check to inject the Google Tag Manager’s Data Layer JavaScript object (see here for more details)
  • License key: Your purchased DNN Google Tag Manager license key

Host Configuration

If you are the DNN Host Admin, you can go to /Host/Google-Tag-Manager to get an overview of your portal’s Google Tag Manager integrations. This is especially useful if you run multi-portal instances. As of now, there is nothing you can configure here – such options may follow in a future release.

Data Layer

If the portal specific option “Enable data layer” is checked an empty data layer object is injected:

dataLayer = [];

To add custom data to the data layer object, you can add a class that implements weweave.DnnGoogleTagManager.Extension.IDataLayerProvider to your backend code. A sample implementation looks like this:

public class SampleDataLayerProvider : weweave.DnnGoogleTagManager.Extension.IDataLayerProvider
  /// <summary>
  /// Updates the data layer
  /// </summary>
  /// <param name="request">Request to update the data layer
  /// <param name="user">User to update the data layer (or null for anonymous requests)
  /// <param name="dataLayer">Data layer to update
  /// <returns>Updated data layer</returns>
  public Dictionary<string, string=""> UpdateDataLayer(HttpRequestBase request, UserInfo user, Dictionary<string, string=""> dataLayer)
    dataLayer["key1"] = "value1";
    dataLayer["key2"] = "value2";
    // ...
    return dataLayer;

  /// <summary>
  /// Priority of this IDataLayerProvider implementation; implementation with higher lower priority can override the
  /// data layer of implementation with lower priority
  /// </summary>
  /// <param name="request">Request to get the priority for
  /// <param name="user">User to get the priority for (or null for anonymous requests)
  /// <returns>Priority of this IDataLayerProvider implementation</returns>
  public int GetPriority(HttpRequestBase request, UserInfo user)
    return 1;

The module automatically creates new instances of all defined IDataLayerProvider and calls UpdateDataLayer(…) in the order of the providers’ priorities to get all data for the data layer.


Enabling debug logging

Add the following lines right before the closing “</log4net>” to the file DotNetNuke.log4net.config which you’ll find in your website’s root directory.

<logger name="weweave.DnnGoogleTagManager">
    <level value="Debug" />

Debug output will be written into the log files in this directory: Portals\_default\Logs


You can easily remove DNN Google Tag Manager from your DNN installation by navigating to “Host > Extensions”.