From 3867ea605ae82e92c454487ef5b59d8c3b6c76fc Mon Sep 17 00:00:00 2001 From: Ryan Sebastian Date: Mon, 21 Jul 2025 10:56:41 -0700 Subject: [PATCH 1/3] updated JavaScript wrapper link to non-archived location --- .../integrations/google-tag-manager.mdx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pages/docs/tracking-methods/integrations/google-tag-manager.mdx b/pages/docs/tracking-methods/integrations/google-tag-manager.mdx index 08ac8daf91..d70daefd5f 100644 --- a/pages/docs/tracking-methods/integrations/google-tag-manager.mdx +++ b/pages/docs/tracking-methods/integrations/google-tag-manager.mdx @@ -3,16 +3,22 @@ This document walks through Mixpanel's native integration with Google Tag Manager. The source code lives [here](https://github.com/mixpanel/mixpanel-gtm-template). ## Installation + Note: You can also watch our video walkthrough [here](https://user-images.githubusercontent.com/556882/154125933-b584de10-b7fa-4668-b815-7429192d867a.mp4). - + The easiest way to install the custom template is to locate it in the [Google Tag Manager community template gallery](https://tagmanager.google.com/gallery/#/owners/mixpanel/templates/mixpanel-gtm-template), and you can install it via the Google Tag Manager user interface. To **manually install** the template, e.g. for debugging prior to the changes being published in the community template gallery, follow these steps. 1. Download the `./src/template.tpl` file locally. -2. Open a **Google Tag Manager** *Web* container via the [Google Tag Manager user interface](https://tagmanager.google.com/). Preferably one that is already deployed on a website where you can test the template with real use cases. +2. Open a **Google Tag Manager** _Web_ container via the [Google Tag Manager user interface](https://tagmanager.google.com/). Preferably one that is already deployed on a website where you can test the template with real use cases. 3. In the GTM UI, browse to **Templates**, and in the box titled **Tag Templates**, click the blue **New** button. 4. Once the **Template Editor** is open, click the menu (three vertical dots) in the top-right corner of the window and choose **Import**. 5. Select the `template.tpl` file you downloaded locally. @@ -25,11 +31,11 @@ To **manually install** the template, e.g. for debugging prior to the changes be The template brings the functionality of the [Mixpanel JS SDK](https://developer.mixpanel.com/docs/javascript-full-api-reference) to Google Tag Manager so that you can implement Mixpanel through the Tag Manager interface instead of a direct implementation in code. You will need to define and fire tags using this template to make Mixpanel SDK calls to track events and identify users. -It utilizes a custom-created [JavaScript wrapper](https://github.com/mixpanel/mixpanel-js-wrapper) to overcome the restrictions GTM's templating system places on available JavaScript APIs. +It utilizes a custom-created [JavaScript wrapper](https://github.com/mixpanel/mixpanel-js/blob/master/src/loaders/mixpanel-js-wrapper.md) to overcome the restrictions GTM's templating system places on available JavaScript APIs. ### Initialization -When *any* Mixpanel GTM tag fires, it automatically tries to initialize a new instance using the **Initialization Options** configured in the tag. If an instance with the given name has already been initialized on the page, the initialization process will be skipped. +When _any_ Mixpanel GTM tag fires, it automatically tries to initialize a new instance using the **Initialization Options** configured in the tag. If an instance with the given name has already been initialized on the page, the initialization process will be skipped. This way, the user doesn't need to worry about initialization; just ensure that the Initialization Options are configured consistently across the tags. From 0bcdce9e84dfe9888f4b273efabed9c7f3624b30 Mon Sep 17 00:00:00 2001 From: Ryan Sebastian Date: Mon, 21 Jul 2025 21:53:15 -0700 Subject: [PATCH 2/3] added function mappings for each tag and revised text --- .../integrations/google-tag-manager.mdx | 175 ++++++++++++------ 1 file changed, 122 insertions(+), 53 deletions(-) diff --git a/pages/docs/tracking-methods/integrations/google-tag-manager.mdx b/pages/docs/tracking-methods/integrations/google-tag-manager.mdx index d70daefd5f..3fcc918b3b 100644 --- a/pages/docs/tracking-methods/integrations/google-tag-manager.mdx +++ b/pages/docs/tracking-methods/integrations/google-tag-manager.mdx @@ -1,10 +1,10 @@ -# Google Tag Manager +# Google Tag Manager (GTM) This document walks through Mixpanel's native integration with Google Tag Manager. The source code lives [here](https://github.com/mixpanel/mixpanel-gtm-template). ## Installation -Note: You can also watch our video walkthrough [here](https://user-images.githubusercontent.com/556882/154125933-b584de10-b7fa-4668-b815-7429192d867a.mp4). +Our [video walkthrough](https://user-images.githubusercontent.com/556882/154125933-b584de10-b7fa-4668-b815-7429192d867a.mp4) demonstrates how get started using our GTM template.