Migrate to Google Tag Manager
Stay organized with collections
Save and categorize content based on your preferences.
To gain the most value from Google Tag Manager, you should migrate all (or as
many as possible) of your existing tags into Tag Manager. The recommended steps
are as follows:
Map your site (optional)
Think about which tags you might currently have deployed on your site. Think
about what actions (events) you want to track and what data (variables)
you'll want to collect. Create a map of tags, the data to be collected, and
which events or pages you want to associate with those tags.
Install the Tag Manager code on your site
Once you've mapped your site, install the Tag Manager container tag on your
site and deploy it. Read the installation guidance for more information.
Add Events and Variables
Customize your Google Tag Manager installation using the methods outlined in
the events guidance.
Configure tags and their associated triggers in Tag Manager
Once Tag Manager is installed on your site, you should add your site tags to
the user interface. DO NOT publish at this time. Simply add and configure
the tags from your site in Tag Manager with appropriate tag templates and
triggers. Learn more about triggers.
Final migration swap
The last step is where you simultaneously swap out your old tags and publish
your tags in Google Tag Manager. Within a few minutes of each other, you'll
want to:
- Remove your site tags in a single code push
- Once you know this push is successful, press the "Publish" button for your
container version.
This method might cause a small gap in data, but once the initial swap is
complete, no more gaps will appear. Alternatively, you could swap the order
here and publish shortly before your site changes go live. This might cause
minor, one-time data duplication instead of a small data gap.
After you've completed the initial migration to Tag Manager, any subsequent tag
configuration needs can be handled without code changes via the Tag Manager
interface.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[null,null,["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eMigrate all existing website tags to Google Tag Manager for centralized management.\u003c/p\u003e\n"],["\u003cp\u003eMap your website's tags, data, and events for a smooth transition.\u003c/p\u003e\n"],["\u003cp\u003eInstall Tag Manager code, add events and variables, and configure tags within the interface.\u003c/p\u003e\n"],["\u003cp\u003eSwap out old tags with the new Tag Manager setup to complete the migration.\u003c/p\u003e\n"],["\u003cp\u003eManage future tag configurations without code changes through the Tag Manager interface.\u003c/p\u003e\n"]]],["To utilize Google Tag Manager, migrate existing tags by mapping your site's tags, data, and events. Install the Tag Manager code, then customize it with events and variables. Configure tags and triggers within Tag Manager's interface. Lastly, simultaneously remove old site tags and publish the configured tags in Tag Manager, which you can do in a few minutes. After migration, future tag adjustments occur through Tag Manager's interface without code changes.\n"],null,["# Migrate to Google Tag Manager\n\nTo gain the most value from Google Tag Manager, you should migrate all (or as\nmany as possible) of your existing tags into Tag Manager. The recommended steps\nare as follows:\n\n1. **Map your site (optional)**\n\n Think about which tags you might currently have deployed on your site. Think\n about what actions (events) you want to track and what data (variables)\n you'll want to collect. Create a map of tags, the data to be collected, and\n which events or pages you want to associate with those tags.\n2. **Install the Tag Manager code on your site**\n\n Once you've mapped your site, install the Tag Manager container tag on your\n site and deploy it. Read the [installation guidance](https://support.google.com/tagmanager/answer/14842164) for more information.\n3. **Add Events and Variables**\n\n Customize your Google Tag Manager installation using the methods outlined in\n the [events guidance](/tag-platform/devguides/events).\n4. **Configure tags and their associated triggers in Tag Manager**\n\n Once Tag Manager is installed on your site, you should add your site tags to\n the user interface. DO *NOT* publish at this time. Simply add and configure\n the tags from your site in Tag Manager with appropriate tag templates and\n triggers. [Learn more about triggers](https://support.google.com/tagmanager/topic/7679384).\n5. **Final migration swap**\n\n The last step is where you simultaneously swap out your old tags and publish\n your tags in Google Tag Manager. Within a few minutes of each other, you'll\n want to:\n - Remove your site tags in a single code push\n - Once you know this push is successful, press the \"Publish\" button for your container version.\n\n This method might cause a small gap in data, but once the initial swap is\n complete, no more gaps will appear. Alternatively, you could swap the order\n here and publish shortly before your site changes go live. This might cause\n minor, one-time data duplication instead of a small data gap.\n\nAfter you've completed the initial migration to Tag Manager, any subsequent tag\nconfiguration needs can be handled without code changes via the Tag Manager\ninterface."]]