Google Tag Manager Template Quickstart Guide
Use the official Amplitude Analytics Google Tag Manager templates to collect data. Choose a template to visit the documentation and tutorial video.
|Amplitude Analytics Browser SDK||Client-side||The tag uses the Amplitude Marketing Analytics SDK for data collection.|
|Amplitude Analytics||Server-side||The tag uses the Amplitude HTTP V2 API for data collection.|
Amplitude's GTM templates offer a convenient way for developers to set up event tracking in their applications. These pre-configured templates provide a streamlined solution for deploying tracking tags, reducing the time and effort required to set up event tracking. Learn more about Google Tag Manager Templates.
How Amplitude GTM templates fit into your workflow¶
The data layer is an object used by Google Tag Manager and Google tag (gtag.js) to pass information to tags. Events or variables can be passed via the data layer, and triggers can be set up based on the values of variables.
Amplitude GTM templates are custom templates which define tags and variables so that you can reuse them alongside the built-in tags and variables.
Google tags are snippets of code that measure user activity such as time on page, clicks, and purchases.
Learn more about the client-side container.
Client-side container communicates with the server-side container through HTTP requests with the standardized Event Data format.
The client container might be also required because it needs to parse an incoming HTTP request and generate an event data object for tags to utilize.
Learn more about the service-side container.
Client-side vs server-side¶
Google Tag Manager (GTM) offers both client-side and server-side templates for tag deployment. GTM client side templates and GTM server side templates differ in the way they execute the tracking plan.
Server-side templates operate on the server rather than the client's browser, whether that be Google Cloud or any Self-Hosted Server. It's important to understand that server-side templates aren't designed to replace GTM client-side tags, but rather to augment and enhance their performance. If your focus is on improving client-side loading speed, bolstering security, or addressing privacy concerns, then using GTM server-side templates can be a viable option. More details.
Use GTM client-side templates to track user interactions on a website. Use server-side templates if you want to track sensitive customer information or complex tags that require server-side processing.
Install the template¶
- Go to Tag Manager and select your container or set up a new one.
- Open the Templates tab and click Search Gallery in the Tag Templates section.
- Type "Amplitude" in the search bar and select the Amplitude GTM Template.
- Add the template to your workspace by clicking "Add to Workspace".
Create a tag¶
After installing the template, you can then use that template to create a tag.
Consult the corresponding template document for more information and EU configuration.
- Go to the Tags tab in your Google Tag Manager Workspace and click New.
- Select the Amplitude GTM Template from the list of available templates under Tag Configuration. If you haven't installed an Amplitude GTM Template, install the template first.
- Enter your Amplitude API Key in the Tag Configuration section.
- Choose a trigger that you want to use to fire the tag in the Triggering section.
- Save your tag and publish your GTM container.
Check for success¶
Verify that the Amplitude tag is firing correctly by checking the Debug mode in GTM and debugging Analytics.
To learn more about each template and see a tutorial video, click the template name in the table at the beginning of this page.