Add the Google Tag Manager script to Dev Portal

TL;DR

In the settings for your Dev Portal, click the Integrations tab, configure Google Tag Manager with your GTM container ID, and enable the integration.

Prerequisites

For this tutorial, you’ll need a Dev Portal pre-configured. If you don’t have these settings already configured, follow these steps to pre-configure it:

  1. In the Konnect sidebar, click Dev Portal.
  2. Click New portal.
  3. Enter a name for your Dev Portal.
  4. Click Create and continue.
  5. Customize your Dev Portal’s appearance.
  6. Click Save.

You need an active Google Tag Manager account with a container configured. Copy and save your container ID.

You can add Google Tag Manager to your Dev Portal to manage tracking and analytics tags across all Dev Portal pages without modifying Dev Portal code. After it’s configured, your Google Tag Manager container script will be injected into every page of your Dev Portal, allowing you to manage tags like Google Analytics and more from Google Tag Manager.

Configure the Google Tag Manager integration

Configure the Google Tag Manager integration in your Dev Portal settings.

  1. In the Konnect sidebar, click Dev Portal.
  2. Click your Dev Portal.
  3. In the Dev Portal sidebar, click Settings.
  4. Click the Integrations tab.
  5. Click Google Tag Manager.
  6. Click the Enabled toggle.
  7. In the Google Tag Manager ID field, enter your Google Tag Manager container ID.
  8. Optional: Click Advanced configuration to configure data layer and other settings.
  9. Click Save.

Validate

You can verify that the integration is working as expected by navigating to your Dev Portal URL and inspecting the Network information on the page. You should see your Google Tag Manager information there.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!