具有动态 PHP 转化价值的 Google AdWords 报告

发布于 2024-08-24 03:32:45 字数 817 浏览 5 评论 0原文

我正在使用 Google Adwords 推送和跟踪我网站上的订阅者获取情况,但无法使转化报告发挥作用。

这是我的设置。

我的订阅表单由我创建的 Wordpress 插件动态加载到我的订阅页面上。验证后,表单将替换为 php 的感谢消息,因此用户不会重定向到确认页面。因此,我认为我需要检查转化值的输出才能让 Adwords 报告。

我已遵循 AdWords 帮助文档,并将报告设置为“购买/销售”跟踪,以便我可以测试 conversion_value 变量。

这是我的插件代码,用于输出感谢消息。

//****[ Variable Conversion Value For Google AdWords]****
$variableConversionValue = '<h3 class="subscribeConfirm">Thanks for signing up!</h3>';

//****[ After writing subscriber data, display thank you message****
echo $variableConversionValue;

这是我的订阅页面(是一个 php 页面,但跟踪不包含在 php 标签内)上的 Adwords 跟踪(不包括通用跟踪代码)。

if (<? echo $variableConversionValue; ?>) {
  google_conversion_value = <? echo $variableConversionValue; ?>;
}

您能帮我让报告正常工作吗?谢谢!

I am using Google Adwords to push and track subscriber acquisitions on my site, but can not get the conversion reporting to work.

Here is my setup.

My subscribe form is dynamically loaded on my subscribe page by a Wordpress plugin I created. After validation the form is replaced with a thank you message with php, so the user is not redirected to a confirmation page. Because of this, I think I need to check for the output of a conversion value to get Adwords to report.

I have followed the adwords help docs and have made the reporting a "purchase/sale" tracking so I can test for the conversion_value variable.

Here is my plugin code that outputs the thank you message.

//****[ Variable Conversion Value For Google AdWords]****
$variableConversionValue = '<h3 class="subscribeConfirm">Thanks for signing up!</h3>';

//****[ After writing subscriber data, display thank you message****
echo $variableConversionValue;

Here is my Adwords Tracking (did not include generic tracking code) that is on my subscribe page (is a php page, but the tracking in not contained within php tags).

if (<? echo $variableConversionValue; ?>) {
  google_conversion_value = <? echo $variableConversionValue; ?>;
}

Can you please help me get the reporting to work? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吹梦到西洲 2024-08-31 03:32:45

我不确定您是否理解转换值的目的。如果您正在寻找二进制“发生转换”,我不确定您是否需要指定一个值,但如果您这样做,您应该使用像 1 这样的数字或任何您认为潜在客户的美元价值是。我可能是错的,但我不认为 Adwords 能够将值中的文本/html 处理为任何有意义的内容。

如果用于检查表单和输出的代码位于两个不同的位置(如上面所示),也许您真正想要的输出是:

if (<? echo $variableConversionValue; ?>) {
  google_conversion_value = <? echo '1'; ?>;
}

I'm not sure you are understanding the purpose of the conversion values. If you are looking for a binary "the conversion occurred", I'm not sure you need to specify a value at all, but if you do, you should be using a number like 1 or whatever you feel the dollar value of a lead is. I may be wrong, but I don't think Adwords will be able to process text/html in the value as anything meaningful.

If your code for checking the form and output are in two different places (as it looks like from above), maybe what you really want in your output is:

if (<? echo $variableConversionValue; ?>) {
  google_conversion_value = <? echo '1'; ?>;
}
情独悲 2024-08-31 03:32:45

我已经想通了。

当使用上面的代码查看我的实时页面源代码时,echo $variableConversionVale 代码为空,这意味着它没有正确传递值。因此,我没有使用变量,而是准确输入了要显示的内容来跟踪转换。

示例:

if ('

感谢您注册!

') {
google_conversion_value = '

感谢您注册!

'; >>

使用上面的代码,仅当弹出您已订阅的确认信息时,它才会跟踪转化

步骤下此处的参考链接 4“插入代码片段的不同场景”

谢谢!

I have figured it out.

When viewing my live page source with the code above, the echo $variableConversionVale code was blank, meaning it was not carrying the value over correctly. So instead of using the variable, I put in exactly what would be displayed to track the conversion.

Example:

if ('<h3 class="subscribeConfirm">Thanks for signing up!</h3>') {
google_conversion_value = '<h3 class="subscribeConfirm">Thanks for signing up!</h3>'; />
}

Using the above code, it tracks a conversion only when the confirmation that you have been subscribed pops up.

Reference link here under step 4 "Different scenarios for inserting the code snippet"

Thanks!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文