【发布时间】:2019-01-25 14:30:43
【问题描述】:
所以,我正在实现一个需要通过 Google 跟踪代码管理器添加的像素,并且需要将一个变量传递给它。
GTM 代码已添加到网站。 (这是谷歌给出的通用代码)。
需要触发的像素位于 thakn you 页面上并在调试模式下查看,我可以看到该标记有效。
我需要将数据传递给这个标签,所以我创建了一个 dataLayer 标签
再次在调试模式下,我可以看到这是可行的。
但是,我不确定如何将这些数据传递到标签中。
谷歌标签:
<img src="https://prf.hn/conversion/campaign:1101l598/conversionref:{{ The dataLayer variable to be included here}}/currency:GBP" height="1" width="1" />';
数据层是:
dataLayer.push({
'oppId': <%= current_customer.opportunities.last.id %>
});
谁能帮助我,以便在渲染像素时,它会显示如下内容:
<img src="https://prf.hn/conversion/campaign:1101l598/conversionref:12345678/currency:GBP" height="1" width="1" />';
【问题讨论】:
标签: google-tag-manager google-datalayer