Google タグ マネージャーに移行する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google タグ マネージャーを最大限に活用するには、既存のタグのすべて(できるだけ多く)をタグ マネージャーに移行してください。おすすめの手順は次のとおりです。
サイトをマッピングする(省略可)
サイトにどのタグを現在デプロイしているか、どのアクション(イベント)をトラッキングし、どのデータ(変数)を収集するかを検討したうえで、タグ、収集するデータ、それらのタグに関連付けるイベントまたはページのマップを作成します。
タグ マネージャーのコードをサイトにインストールする
サイトをマッピングしたら、タグ マネージャーのコンテナタグをサイトにインストールしてデプロイします。詳しくは、インストール ガイドをご覧ください。
イベントと変数を追加する
イベント ガイダンスに記載されている方法で、Google タグ マネージャーのインストールをカスタマイズします。
タグ マネージャーでタグと関連するトリガーを設定する
タグ マネージャーをサイトにインストールしたら、サイトタグをユーザー インターフェースに追加する必要があります。この時点では公開しないでください。タグ マネージャーで、適切なタグ テンプレートとトリガーを使用して、サイトのタグを追加、設定します。詳しくはトリガーの詳細をご覧ください。
最後に移行のために置き換える
最後のステップでは、古いタグを同時に置き換えて、Google タグ マネージャーでタグを公開します。数分以内に以下を行う必要があります。
- 1 回のコードプッシュでサイトのタグを削除します。
- このプッシュが成功したことを確認したら、お使いのコンテナ バージョンの [公開] ボタンを押します。
この方法では、データに小さなギャップが生じる場合がありますが、最初の置き換えが完了すると、ギャップはなくなります。または、順序を入れ替えて、サイトの変更を有効にする直前にタグを公開することもできます。この場合、データに小さいギャップは生じませんが、データの軽微な重複が 1 回だけ発生する可能性があります。
タグ マネージャーへの最初の移行が完了したら、それ以降のタグ設定は、コードを変更しなくてもタグ マネージャーの管理画面から行えます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-07-29 UTC。
[null,null,["最終更新日 2024-07-29 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."]]