
2020年10月6日
Implement Pinterest的 Tag with Google Tag Manager
在选择跟踪像素时,Pinterest(在大多数情况下)可能不会达到前3名。但是,如果您’在一家公司工作’与时尚,风格有关,Pinterest Tag肯定是一个选择。
最近,我第一次遇到了Pinterest标签(通常是因为人们要求我提供GA或Facebook Pixel的帮助),以及…那是什么。虽然不是’t terrible, it wasn’既出色又精简。
主要是由于缺乏在线文档和其他资源。
After playing around with it, 这里 are my findings on how to implement Pinterest的 Tag with Google Tag Manager.
注意: 如果您发现任何错误,请告诉我,我’尽快修复。我可能仍然错过了一些地方。

目录
+显示目录+
#1介绍
我不会深入探讨跟踪像素对营销活动的好处和重要性。如果您对其他像素(例如Facebook Pixel)至少有不错的经验,那么您’我已经知道了大部分故事:
- 报告转化的能力
- 建立受众群体和更精确的定位等能力。
尽管该行业正在快速变化,并且浏览器在跟踪方面也变得越来越严格,但您仍然可以找到本指南,直到cookiegeddon形成最终形式为止。
现在,回到主要主题Pinterest标签。它可能的原因之一’之所以受欢迎,是因为受支持的国家/地区列表不如其他主要参与者(FB或Google)那样大。
首先,您需要注册到 //ads.pinterest.com/Â转到 广告> Conversions. 然后你 will be asked to install the Pinterest的 Tag. Since this blog is mainly dedicated to Google Tag Manager, we’我一定会选择“Add code to website” option. Click 添加代码 按钮。
然后你’将会看到您应该添加到网站的Pinterest标签代码。但是,由于我们正在使用GTM,因此您要做的就是复制像素ID(位于右上角)。我们’ll use it very soon.
#2。浏览量跟踪
First, you should start with pageview tracking. This means 那 on every page, you should activate the basic Pinterest的 Tag code. To do 那, go to 标签 (在GTM界面中) > New > Pinterest的 Tag 并输入以下设置。
此标签的触发器是“All pages”
On some pages of the Pinterest的 TAg documentation, you are told to first create the Base pixel tag (where the 事件触发 字段设置为 仅基础代码(无事件)),但经过各种测试后,如果您在GTM中使用Pinterest标签模板,则看起来这完全没有必要。即使没有基本代码标签,事件(使用该模板配置)也可以正常工作。
那’这就是为什么我只创建了 页面访问 标签。
但是,如果您想启用以下功能“启用元数据充实” to all your Pinterest的 标签, you then might want to create a Base pixel tag and fire it first on a page (with GTM标签排序)。
说到标记中的其他字段,您可以输入访问者/用户的电子邮件地址以启用“增强匹配”功能。您可以在字段中插入哈希电子邮件,也可以插入常规电子邮件地址,然后像素将为您哈希。然后将散列的值发送到Pinterest服务器。
您可以从哪里获得电子邮件地址?一种可能的方法是要求开发人员将电子邮件发送到 资料层.
保存标签。
#3。测试标签
现在它’是时候检查网页浏览是否被正确跟踪了。安装一个名为Chrome的扩展程序 Pinterest的 Tag Helper. After you do 那, refresh the GTM预览模式Â and then refresh the page where you want to install the Pinterest的 Tag.
如果综合浏览量发送正确,则扩展名的颜色’的图标将改变。点击它。
Then, you will see what kind of information was sent to Pinterest的. 您 can click 那 event (Page visit) to see what URL was tracked.
最后,你’ll also need to check if the data was properly received by Pinterest的. To do 那, go to ads.pinterest.com> 广告> Conversions > Test 事件s。输入您要在其中实现像素的页面的URL。单击启动。
After this has happened, you should start seeing the page visit being received. 您 should later repeat the same process with every interaction 那 you want to send to Pinterest的.
#4。追踪其他事件
Page visit is not the only interaction 那 is supported by Pinterest的 Tag. There is a longer list available 这里。撰写本文时,其他受支持的事件包括:
受众群体创建和转化报告均支持其中的大多数。创建受众群体意味着您可以根据人们进行的互动(例如,观看特定视频或订阅新闻通讯或其他内容)来创建受众群体。
说到自定义事件,我在此博客文章中有一章对此进行了单独介绍。现在,让’返回标准事件。一世’将逐步向您展示一个示例。但是,如果您想全力以赴,那您’我们将需要全面了解Google跟踪代码管理器的功能(第 那’这是我的课程的全部内容)。
让’s say 那 we want to send events when a visitor subscribes to our 通讯. There are various methods on 如何追踪表格Â但让’想象一下,这次,我们正在与开发人员合作,他/她将表单提交数据推送到 资料层. 这里’s an example:
<script> window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event': 'email_optin', 'formType': 'newsletter' }); </script>
To send this data to Pinterest的, we will need to:
- 创建一个 自订 事件 trigger叫做 email_optin
- 创建一个 数据层变量叫做 formType
- 创建一个 Pinterest的 Tag
#4.1。触发和变量
在Google跟踪代码管理器中,转到 扳机> New > 自订 事件 并输入以下设置:
It’s important 那 the event name (email_optin)的输入完全一样。保存触发器。
然后去 变数>用户定义的变量> New > 数据层变量 并输入以下设置:
“数据层变量名称”字段区分大小写。保存变量。我们为什么要这样做?因为我们要发送的价值 formType to Pinterest的 Tag.
还有一件事。由于我们将为此事件创建另一个标签,因此在标签中手动输入Pixel ID并不是最佳选择。相反,我们可以创建一个变量(类型:常量)并在其中输入Pixel ID。去 变数>用户定义的变量> New > Constant 然后在此处输入您的像素ID。
保存变量。我们’下一步将使用它。
#4.2。创建标签
去 标签> New > Pinterest的 Tag 并输入以下设置:
在 the 铅 类型field, I inserted the 资料层 variable 那 returns the information about the form 类型(that a visitor submitted).
仔细看看 标签ID 领域。我没有输入像素ID,而是输入了先前创建的由{{}}包围的常量变量。
在 the triggering section, I have assigned the previously created 自订 事件 trigger. 保存标签。
Speaking of the constant variable, you should go back to the Page visit Pinterest的 tag and replace your Pixel ID with the constant variable.
为什么?因为从现在开始,所有Pinterest标签将使用相同的变量(包含ID)。如果在将来的某个时候,我们决定切换ID,则只需执行一次–在常量变量中。然后,所有Pinterest标签将自动继承该ID。
#4.3。测试标签
创建2个变量,1个标签和1个触发器后,请刷新 GTM预览模式Â并检查:
- Pinterest的 Tag Helper
- Pinterest的Â 测试事件 报告
参见第3章Â了解更多信息。
#5。事件参数(标准和自定义)
与事件一起,您可以发送 参数。有些参数在标签模板中已经有预定义的字段,而另一些可以作为自定义参数添加。
在 general, the data model of Pinterest的 Tag is quite flexible and will accept pretty much anything 那 you pass.
但首先,让’看看那些提到的 在官方文件中.
页面访问事件
标签模板提供了两个附加的预定义字段:
- 产品编号
- 产品分类
如果您要跟踪产品的综合浏览量(当访客访问某个产品的页面时),这两个字段都将很有用。如果您想通过同一浏览量传递多个产品,则需要点击“Custom 参数”复选框,然后输入密钥 line_items 产品数据必须以以下方式格式化:
[ { 产品名称: 'Parker Boots', product_id: '1414', 产品价格: 5.00, product_quantity: 1 }, { 产品名称: 'Parker Sandals', product_id: 'ABC', 产品价格: 5.00, product_quantity: 1 } ]
It must be an array where every product is an object. And every object must contain 参数 那 are named exactly like in the example above. 这里’s what a Pinterest的 Tag could look like:
您如何将line_items数据作为GTM变量获取?您可以要求开发人员将产品数据推送到 资料层 格式如下(其中line_items是数组):
然后使用参数名称创建一个数据层变量 line_items:
说到订单项,这些是当前受支持的参数(老实说,’t试图在那里添加自定义参数,但是我’我很确定他们也可以使用):
- 产品名称
- product_id
- 产品分类
- product_variant_id
- product_variant
- 产品价格
- product_quantity
- product_brand
不确定这些参数的格式吗? 请参阅文档.
Not sure which 参数 are the most important to the Pixel? Try to send the event to Pinterest的 and see what kind of warnings or errors are you seeing in the Pinterest的 Tag HelperÂ,并且,如果可能,尝试修复它们。
加入购物车活动
Add to Cart event in the Pinterest的 tag template asks you a bunch of additional info:
- 订单价值
- 货币
- 订货量
- 订单编号
如果您只想传递一种产品,则可以填写以下两个字段:
- 产品编号
- 产品分类
如果同时将更多产品添加到购物车,请添加自定义参数 line_items (就像我在 页面访问 追踪部分)。
如果您想知道从哪里可以得到这些数据(以便在代码中使用),在大多数情况下,您可能需要与开发人员合作,并要求他/她将这些数据传递给 资料层,然后从那里拿走 数据层变量Â and insert those variables in the Pinterest的 Tag.
查看 event
如果您使用Google Analytics(分析)中的增强型电子商务比使用Pinterest标记更多,那么您可能会发现“Checkout” a bit misleading. 在 GA Enhanced Ecommerce, 查看 is when the visitor starts entering the billing information, shipping information, etc.
实际交易不属于交易的一部分。
But in Pinterest的 Tag, checkout is the actual payment. When a visitor/user makes a purchase, a 查看 event must be sent to Pinterest的.
当你选择“Checkout” event in the Pinterest的 tag template, you’需要输入以下字段:
- 订单价值
- 货币
- 订单数量(购买了多少商品)。如果有3个产品X和2个产品Y,则值应为5
- 订单编号
- 如果它’可能总是只购买一种产品,您可以填写两个字段:
- 产品编号
- 产品分类
- 但是,如果产品数量可能有所不同,请添加自定义参数 line_items 而是以以下方式对其进行格式化:
[ { 产品名称: 'Parker Boots', product_id: '1414', 产品价格: 5.00, product_quantity: 1 }, { 产品名称: 'Parker Sandals', product_id: 'ABC', 产品价格: 5.00, product_quantity: 1 } ]
要了解更多有关 line_items 参数, 阅读有关页面访问跟踪的章节 在这篇文章中。
谈到所有产品参数,您可以添加以下内容:
- 产品名称
- product_id
- 产品分类
- product_variant_id
- product_variant
- 产品价格
- product_quantity
- product_brand
当涉及到参数及其值的格式时,始终 参考官方文档。他们那里有一些例子。
注册
If visitors can signup/register, you should send a signup event. When you select this event in the Pinterest的 tag template, you can also enter the field called 引线类型.
如果人们可以在其中创建多个注册表单,这将很有用。如果您想跟踪某人何时成为潜在客户(例如,选择加入您的新闻通讯或下载电子书,’d使用其他事件类型, 铅)。关于它的更多信息— later.
看视频
如果您的网站上有一些视频,则可以通过此事件进行跟踪。例如,如果访问者观看了至少50%的视频,则可以发送“Watch video” event to Pinterest的.
为此,你’d需要创建一个触发器,该触发器专门在达到50%标记时触发标签。阅读此博客文章以了解更多信息 视频跟踪.
与此事件一起,您可以发送一个自定义参数,称为 video_title 为了确定观看了哪个确切的视频。还提到了此参数 在文档中.
正如我所提到的,Pinterest标签’的数据模型非常灵活。如果您要发送有关视频的更多自定义参数,则可以这样做(至少基于我的’已经看到)。这些参数可用于建立受众。
这些自定义参数的名称取决于您。但是看一下Pinterest中显示的命名约定’s documentation, I’d建议使用全小写+下划线,例如, video_id,video_author等
铅
When someone becomes a lead (e.g. downloads an e-book, subscribes to a 通讯), use this event type. When you select it in the Pinterest的 Tag template, you can also fill in a field called 引线类型.
这可以是访问者提交的一种表单类型(例如“newsletter”, “landing page”, “purchase form”等等)或实际表格的名称(例如“newsletter popup”, “关于减肥的电子书”, etc.)
另外,您可以传递文档中未描述的一些临时参数。例如,您可以使用 引线类型 像这样发送信息的字段“newsletter”, “landing page”,然后包含另一个参数 表格名称 其中包含铅磁铁的名称。
请记住,我只是想出了 表格名称 名称。您可以根据需要使用其他任何名称。
搜索
如果您的网站提供搜索功能,则您绝对可以对其进行跟踪并将搜索词发送到像素。如果你不这样做’不知道从哪里获得搜索查询(作为GTM变量), 阅读本指南.
准备好变量后,将其插入“Search query” field (after the “Search”标签中选择了事件)。
查看类别
访客查看类别(例如产品类别或文章类别)的页面/列表时,可以将其发送到像素。我没有’因此,使用了这么多时间并不能提供很多见解/技巧。
看了Pinterest之后的’的文档,我找不到专门用于此事件的任何参数(请注意, 产品分类 参数是为 line_items 数组)。
我的猜测是’足以发送 查看分类 事件本身,或者您也可以通过 line_items 数组。但是我经过一个平原之后 查看类别 没有任何自定义数据的事件, Pinterest的 Tag Helper 没有显示错误。
自订 参数
Based on various experiments, it looks like Pinterest的 Tag’的数据模型非常灵活,甚至可以接受文档中未描述的那些参数。
想要发送一些非常独特的参数 video_length 与 看视频 事件?您可以自由这样做。这些数据将在以后提供 建立目标对象以重新定位.
#6. 自订 events
What if you want to track interactions 那 are not in the list of standard events? For example, 滚动ing, link clicks, time spent on a page, etc.?
I have some good and some bad news. 您 can send them to Pinterest的 too, however, be aware of the limitations:
- 如果您使用 事件触发 类型“Custom”,您可以在转化报告中使用它,但是,您不能指定它是哪种自定义事件。至少那个’s what I saw (if I’是错的,请让我知道。
- 在转化报告中,您可以看到有多少“Custom” events were made but you cannot see whether 那 event is 滚动ing, clicking, time, or something else. 在 fact, when you select “Custom”类型,没有字段可让您指定当时的事件类型。不是很有用。但是您可以尝试使用一些自定义参数来克服此问题,例如,custom_event_name ,并将其与自定义事件一起发送。我没有’尝试过这个,所以,不要’不知道这将如何影响您的转化报告。自行承担风险。
- 如果要发送带有某些自定义名称的自定义事件,则可以发送用户定义的事件。
- However, you cannot use the Pinterest的 tag template in GTM (because as far as I can see, there is no such option there).
- 您’ll need to use the 自订 HTML 标签。
- 即使这样做,您也将无法在转化报告中看到此类自定义事件。此外,每个像素只能有一个用户定义的(这是总数)。每个新的用户定义事件名称都重写了先前的事件’的名字。 #not_very_helpful。
所以让’看看如何跟踪自定义事件的两个选项。
#6.1。“Custom” event
我不’觉得这个特殊的事件类型非常有用。当然,您可以发送自定义事件,但是如果您有10个不同的自定义事件怎么办?转化报告中的所有内容都将以相同的方式显示“Custom”事件。但是,如果您在网站上只有一个自定义事件(听起来有些怪异),那么您可能想要使用它。
在这种情况下,您可以使用以下设置创建标签:
我没有显示触发部分,因为它’完全取决于您。 GTM是一种灵活的工具,可让您跟踪 点击之类的东西, 滚动ing, 页面停留时间等
此时,您可能在想:如果我发送一些自定义参数(例如,“custom_event_name”)以及自定义事件?当然可以。请记住,该参数将在“转化”报告中不可见(除非Pinterest将来会进行一些更新)。
您 can add additional 参数 in a tag by clicking the 自订 Parameters checkbox and entering Parameter 名称 and Value.
例如,如果您要发送 custom_event_name “spent 5 minutes”, you’d need to do this:
测试活动时,请检查“Test events”Pinterest标记界面(ads.pinterest.com)部分。在里面,你’会看到CUSTOM事件,但是如果单击它,’将会看到更多参数,您以后可以在建立受众群体时使用它们。
Speaking of trivial events (such as 滚动ing), I would not send them as CUSTOM events because then your conversion 报告s would show way too many conversions (that are simply just regular events and 不要’影响业务底线)。
#6.2。用户定义的事件
重要: I’跟踪用户定义的事件时,结果有些奇怪。最终,我意识到每个像素只能有一个用户定义的事件。例如,如果您首先发送用户定义的事件,其名称为“scroll”然后发送一个名为“engaged user”,只有后者会显示在“受众群体构建者”之类的地方。这是对Pinterest的一个超级奇怪的决定’s behalf. If I’错误或遗漏了一些东西,请告诉我。
===
User-defined (a.k.a. partner-defined) event cannot be used in conversion 报告ing. But you can use it to build audiences. The implementation process 这里 is a little different. We will need to combine the 自订 HTML tag with the Pinterest的 Tag base code.
First, create a Pinterest的 Tag Base code (no event) tag, 不要’t分配任何触发器,然后将此标签设置为每页仅触发一次。
Then create a 自订 HTML tag with the following code:
<script> pintrk('track', 'some_custom_name', { some_parameter: 'parameter value' }); </script>
更换 some_custom_name with an actual event name. If you want to track 滚动ing, then you could change the values to these:
<script> pintrk('track', 'scroll', { 滚动_distance: {{Scroll Depth}} }); </script>
{{Scroll Depth}}是GTM中的内置变量(您应将其与 rest of the 滚动 setup)。
如果你不这样做’如果要发送任何其他参数(仅事件名称本身),可以将代码简化为:
<script> pintrk('track', 'engaged user'); </script>
如果要添加多个参数,可以执行以下操作:
<script> pintrk('track', 'outbound link click', { file_name: {{file name}}, file_url: {{Click URL}} }); </script>
{{file name}}是一个 自订变数Â返回文件名,{{Click URL}}是内置的GTM变量。要了解如何跟踪文件下载, 阅读本文以获取灵感.
When you have prepared the JavaScript code in the 自订 HTML tag, assign the trigger. It depends on an interaction 那 you want to track thus I will not dive deeper into thousands of possible options. 在 this section, I presume 那 you are already familiar with GTM中的事件跟踪很好。如果不是这样(并且您正在寻找一种快速运行的方式), 看看我的课程.
Also, one more thing: in 那 自订 HTML tag, go to 高级设置> Tag Sequencing and select the previously created Base code tag as a setup 标签。 This setting will make sure 那 the Pinterest的 Tag code is loaded on a page and will process 那 自订 HTML tag’的代码。在大多数情况下,您的常规Page访问代码已经在页面上加载了像素,但是’要安全,总比后悔好。
保存标签并对其进行测试(见第3章)。
在 测试事件 section of Pinterest的 Ads, you will these events as UNKNOWN but if you expand the, you’ll see what data was sent to Pinterest的.
#7。建立观众
我将非常快速地完成这一部分(因为此博客文章的主要重点是“how to collect data”)。如果您想根据事件创建受众群体’已发送,您可以通过转到 广告> Audiences (in the Pinterest的 interface) and create a new audience.
然后选择 访问过您网站的访问者 然后选择您的像素
然后选择“Add a filter”并输入您感兴趣的条件。如果要建立综合浏览量,只需选择 URL包含,然后输入URL。
如果您想根据事件建立观众群,请选择 事件 在下拉菜单中,然后出现奇怪的部分(UI中的错误)。希望他们将来会解决此问题。
如果您点击“Enter your value”字段,然后单击其外部的某个位置,然后再次单击该字段,您’将看到您可以使用的所有事件的列表。
选择事件后,您可以更加具体。点击 添加子规则 然后输入所需的参数。如果您单击该字段,然后单击“离开”,然后再次单击它,则您’将看到您可以选择的所有参数。那’是与上一段相同的怪异错误。
请记住,随着隐私保护功能在大多数现代浏览器中越来越流行,重新定向将越来越受限制。
#8。用户隐私首选项
实施跟踪像素时,请不要’不要忘记一件事,同意。如果访问者不同意出于营销目的进行跟踪,则应在Google跟踪代码管理器中阻止这些代码。这也适用于Pinterest标记。了解有关如何实施尊重用户的设置的更多信息’s preferences, 你可以去这里。它’这是一个非常复杂的设置,但是没有人说隐私很容易。
#9. Reuse GA Enhanced Ecommerce data in Pinterest的 Tag
这里’是一件很酷的事情’这就是为什么我这么爱Google跟踪代码管理器)。如果您已经在某个网站上(通过Google跟踪代码管理器)实施了Google Analytics(分析)增强型电子商务,则很有可能已正确格式化了您的电子商务数据(关于产品,购物车,购买商品)并将其存储在数据层中。
With Google Tag Manager and some JavaScript magic, you can reuse 那 already-existing data from the 资料层 and send the same data to Pinterest的 Tag as well.
这是一个广泛的话题,’这就是为什么我决定发布单独的博客文章来教您如何做的。
How to use GA Enhanced Ecommerce data in Pinterest的 Tag.
Implement Pinterest的 Tag with Google Tag Manager: Final Words
由于Pinterest标签不如Facebook Pixel,Google Analytics(分析)或Google Ads流行,因此我不得不浏览不那么多的不那么深入的资源,以便弄清楚如何正确配置它。
我的意思是,它们并不可怕,但是在某些情况下,它们肯定可以使用一些增强功能和更详尽的示例。
总结一下:
- There is a bunch of standard events 那 Pinterest的 tag supports. 您 should primarily use them.
- 检查Pinterest’的文档,以了解有关可以与事件一起发送的参数的更多信息。一些参数在Pinterest标签模板中可以作为不同的字段使用,而其他参数可以作为自定义参数添加。
- Pinterest的’的数据模型看起来非常灵活。如果要添加一些业务唯一的自定义参数,则可以执行此操作。我建议遵循以下命名约定: all_lowercase_with_underscore.
- 虽然您不能在转化报告中使用自定义参数(实际上,大多数标准参数也未显示在此处,但Â 价值 和 订货量),您仍然可以使用它们来建立重新定位的受众群体(尽管在某些浏览器中重新定位仍然很重要)。
- 自订 event tracking is quite limited. A decision to support only one user-defined variable is exceptionally weird, in my opinion.
This was a little new zone for me as well (as 我不’t work a lot with Pinterest的 tag due to its much lower popularity).
如果您发现任何错误(完全有可能)或得到了一些我没有发现的提示,请随时在下面发表评论。一世’d喜欢学习更多。

你好朱利叶斯,
Will implementing the Pinterest的 tag with Google Tag manager remove the delay in ads 报告ing? It currently has a 24-48 hours delay.
If not with GTM, is there a way to remove the delay? Manually push the data into the 报告s of Pinterest的 for example?