10亿+海关交易数据,1.2亿企业数据,2亿+企业联系人数据,1000千万真实采购商。覆盖200+个国家及地区,95%外贸重点拓展市场,可根据行业、经营范围等多方位挖掘目标客户。
免费试用使用 Google Tag Manager 的注意事项
将 Google 跟踪代码管理器代码添加到您的模板中
验证是否已安装 Google 跟踪代码管理器
相关链接
若要对 Shopify Plus 的在线商店使用 Google Tag Manager,请执行以下操作:
拥有 checkout.liquid
文件的访问权限。如果您无权在模板代码中访问此文件,请联系 Shopify Plus 支持获取访问权限。
将 Shopify 的集成用于 Google Analytics 和 Facebook Pixel,而不是将其用于 Google 跟踪代码管理器。
将 Google Tag Manager 提供的代码片段复制到您的 theme.liquid
和 checkout.liquid
模板文件中。
安装 Google 跟踪代码管理器 以获取您需要复制并粘贴到 Shopify 商店中的代码片段。由于 Shopify 使用模板,因此您只需将代码片段复制到 theme.liquid
和 checkout.liquid
文件。
如果这是您首次安装 Google 跟踪代码管理器,请使用 Google 跟踪代码管理器提供的安装步骤。在您获得要向网页添加的两个代码片段的步骤时暂停,然后按照以下说明操作。
如果您已安装 Google 跟踪代码管理器,则可通过依次点击后台和安装 Google 跟踪代码管理器,在 Google 跟踪代码管理器中找到这些代码片段。
在 Shopify 后台,点击在线商店,然后点击模板。
在模板下拉菜单中,点击编辑代码。
将 Google Tag Manager 中的第一个代码片段复制到您的 theme.liquid
和 checkout.liquid
代码的 <head>
标记中:
复制 Google 跟踪代码管理器中的第一个代码片段
在您的 Shopify 后台中,打开 theme.liquid
文件。
将代码片段粘贴到 theme.liquid
代码的 <head>
中尽可能高的位置。
打开您的 checkout.liquid
文件。
将代码片段粘贴到 checkout.liquid
代码的 <head>
中尽可能高的位置。
将 Google 跟踪代码管理器中的第二个代码片段复制到您的 theme.liquid
和 checkout.liquid
代码的 <body>
标签:
在您的 Shopify 后台,打开 theme.liquid
页面。
将代码片段粘贴到 theme.liquid
页面的 <body>
中尽可能靠前的位置。
打开 checkout.liquid
页面。
将代码片段粘贴到 checkout.liquid
代码的 <body>
中尽可能高的位置。
在 Shopify 后台,点击保存。
在 Google Tag Manager 中,继续安装 Google Tag Manager。当系统提示您添加标记时,请勿添加以下类型的标记:
适用于 Google Analytics 的 Universal Analytics
适用于 Google Analytics 的 Classic Google Analytics
Facebook Pixel。
要验证您是否已正确安装 Google 跟踪代码管理器,您可以使用:
Google 跟踪代码管理器中的预览模式
Google Tag Assistant Chrome 扩展。
theme.liquid
checkout.liquid
Google 跟踪代码管理器文档
在 Shopify 中使用 Google Analytics
在 Shopify 中使用 Facebook Pixel
Shopify商户官网原文详情:
Google Tag Manager
On this page
Considerations for using Google Tag Manager
Add Google Tag Manager code to your theme
Verify that Google Tag Manager is installed
Related links
Considerations for using Google Tag Manager
To use Google Tag Manager with your Shopify Plus online store, you do the following:
Have access to the
checkout.liquid
file. If you don't have access to this file in your theme code, then contact Shopify Plus Support to gain access.Use Shopify's integration for Google Analytics and Facebook Pixel instead of using them with Google Tag Manager.
Copy the code snippets that are provided by Google Tag Manager into your
theme.liquid
andcheckout.liquid
theme files.Add Google Tag Manager code to your theme
Steps:
Install Google Tag Manager to get the code snippets that you will need to copy and paste into your Shopify store. Because Shopify uses templates, you only need to copy the snippets into the
theme.liquid
andcheckout.liquid
files.
If this is your first time installing Google Tag Manager, then use the installation steps provided by Google Tag Manager. Pause at the step where you are given two code snippets to add to your web pages, and then follow the instructions below.
If you have already installed Google Tag Manager, then you can find these code snippets in your Google Tag Manager by clicking Admin, and then clicking Install Google Tag Manager.
In your Shopify admin, click Online store, and then click Themes.
In the theme drop-down, click Edit Code.
Copy the first code snippet from Google Tag Manager into the
<head>
tags of yourtheme.liquid
andcheckout.liquid
code:
Copy the first code snippet from Google Tag Manager
In your Shopify admin, open your
theme.liquid
file.Paste the code snippet as high in the
<head>
of thetheme.liquid
code as possible.Open your
checkout.liquid
file.Paste the code snippet as high in the
<head>
of thecheckout.liquid
code as possible.Copy the second code snippet from the Google Tag Manager into the
<body>
tags of yourtheme.liquid
andcheckout.liquid
code:
In your Shopify admin, open the
theme.liquid
page.Paste the code snippet as high in the
<body>
of thetheme.liquid
page as possible.Open the
checkout.liquid
page.Paste the code snippet as high in the
<body>
of thecheckout.liquid
code as possible.In your Shopify admin, click Save.
In Google Tag Manager, continue installing the Google Tag Manager. When prompted to add tags, do not add the following types of tags:
Universal Analytics for Google Analytics
Classic Google Analytics for Google Analytics
Facebook Pixel.
Verify that Google Tag Manager is installed
To verify that you installed Google Tag Manager properly, you can use:
the Preview Mode in Google Tag Manager
the Google Tag Assistant Chrome Extension.
Related links
theme.liquid
checkout.liquid
Google Tag Manager documentation
Working with Google Analytics in Shopify
Using Facebook Pixel in Shopify
文章内容来源:Shopify商户官方网站
(本文内容根据网络资料整理和来自用户投稿,出于传递更多信息之目的,不代表本站其观点和立场。本站不具备任何原创保护和所有权,也不对其真实性、可靠性承担任何法律责任,特此声明!)
是的,使用googletagmanager不是必须的。您可以选择手动插入您需要的代码片段,但使用googletagmanager可以更简单地管理代码库,同时也可以实现一些功能像测试不同版本的代码等。
如果更改googletagmanager的设置,会不会影响到网站运营?是的,更改googletagmanager中的设置可能会导致网站短暂停用。例如删除已部署的代码库,更改默认的代码版本等操作,都可能需要一定时间重新编译和发布,网站可能处于不可用状态。所以不要轻易更改设置,需要事先测试验证。
googletagmanager能够跟踪所有代码吗?不,googletagmanager无法自动跟踪所有代码。它只能管理您主动添加到代码库中的代码片段。如果需要统计监测的代码未添加到googletagmanager,那么它无法完成跟踪工作。所以需要确保所有需要统计的关键代码均已纳入管理。