Google重定向和转化跟踪代码实施

时间:2022-04-20 15:23:06

I'm running into an issue where my conversion tracking code isn't working.

我遇到了转换跟踪代码无效的问题。

Each piece of code that Google gives you to implement makes reference to the following code:

Google为您提供的每段代码都会引用以下代码:

With retargeting code, you declare several variables:

使用重定向代码,您可以声明几个变量:

var google_conversion_id = 1111111111;
var google_conversion_label = "WWWWWWWWWWWWWW";
var google_custom_params = window.google_tag_params;
var google_remarketing_only = true;

Then you load the conversion script:

然后加载转换脚本:

http://www.googleadservices.com/pagead/conversion.js

... and then for tracking conversions, you also declare some variable and load the same exact script.

...然后,为了跟踪转换,您还要声明一些变量并加载相同的完整脚本。

We are no experiencing inconsistencies with our data, and I'm suspicious of how all of this code is being loaded within the document. The conversion.js script is being loaded several times on the page, when I feel that it should only be loaded once.

我们没有遇到与我们的数据不一致的问题,我怀疑所有这些代码是如何在文档中加载的。转换.js脚本在页面上被多次加载,当我觉得它应该只加载一次。

Then these variables that are being declared ... some are the same, and obviously overwrite the previously declared variables.

然后这些被声明的变量......有些是相同的,显然会覆盖先前声明的变量。

What is the proper way to implement analytics, remarketing and conversion code? Is it just a matter of load priority?

实施分析,再营销和转换代码的正确方法是什么?这仅仅是加载优先级的问题吗?

1 个解决方案

#1


0  

Typically you should only have one tag firing on any one page, so for example a homepage remarketing tag would fire on all homepage pages, a conversion tag will only fire on the sales confirmation page. Although the script is called conversion.js, it's the same for non conversion pages.

通常,您应该只在任何一个页面上触发一个标记,因此例如主页再营销代码会在所有主页上触发,转换标记只会在销售确认页面上触发。尽管该脚本称为conversion.js,但对于非转换页面则相同。

So you should not really see multiple conversion.js calls and if you only have one call, you shouldn't end up overwriting anything.

所以你不应该真正看到多个conversion.js调用,如果你只有一个调用,你不应该最终覆盖任何东西。

Alternatively, if you have a tag that fires everywhere, but want to overwrite with a more specific remarketing tag (home page for example) then just make sure its fired second so you overwrite it with the priority one.

或者,如果您的标签在任何地方都会触发,但是想要使用更具体的再营销代码(例如主页)进行覆盖,那么只需确保将其触发,然后使用优先级覆盖它。

#1


0  

Typically you should only have one tag firing on any one page, so for example a homepage remarketing tag would fire on all homepage pages, a conversion tag will only fire on the sales confirmation page. Although the script is called conversion.js, it's the same for non conversion pages.

通常,您应该只在任何一个页面上触发一个标记,因此例如主页再营销代码会在所有主页上触发,转换标记只会在销售确认页面上触发。尽管该脚本称为conversion.js,但对于非转换页面则相同。

So you should not really see multiple conversion.js calls and if you only have one call, you shouldn't end up overwriting anything.

所以你不应该真正看到多个conversion.js调用,如果你只有一个调用,你不应该最终覆盖任何东西。

Alternatively, if you have a tag that fires everywhere, but want to overwrite with a more specific remarketing tag (home page for example) then just make sure its fired second so you overwrite it with the priority one.

或者,如果您的标签在任何地方都会触发,但是想要使用更具体的再营销代码(例如主页)进行覆盖,那么只需确保将其触发,然后使用优先级覆盖它。