将Google转换代码添加到WordPress联系表单7 [英] Adding Google Conversion code to WordPress Contact Form 7

查看:130
本文介绍了将Google转换代码添加到WordPress联系表单7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了一个将Google转换代码添加到WordPress Contact Form 7插件的教程,可以找到此处



目前我已添加

 < script type =文本/ JavaScript的> 
$(。wpcf7-form)。submit(function(){
var google_conversion_id =12345678910;
var google_conversion_label =xxxxxxxxxxx;
var image = new图片(1,1);
image.src =http://www.googleadservices.com/pagead/conversion/\"+google_conversion_id+\"/?label=\"+google_conversion_label+\"&script=0;
});
< / script>

到我的页脚,但它不会发送正确的结果。有人可以通过WordPress的控制面板将我应该添加到我的联系人表单插件中的信息提供给我,以使我的Analytics显示正确的结果。我不希望重定向到另一个页面。 您正处于正确的轨道上。在此脚本运行时,您可以将结果记录在服务器上。


  1. 实现此目标的最简单最常用的方法是将
    脚本放在一个单独的页面上(通常是一个thank-you.php)并将
    用户重定向到该页面,因此在完成他的活动后,我们可以运行
    这个脚本并记录下活动。

  2. 另一种方式一个棘手的问题,但)是让这个脚本运行
    在用户活动后使用ajax / javascript的相同页面。

我在客户的一个网站上成功实施了第二个Hiteshi Technologies



如果您想在不进行任何重定向的情况下进行设置,您可能会发现这很有帮助。

无转向Google转化跟踪



干杯!!

>

I found a tutorial for adding Google Conversion code to WordPress Contact Form 7 plugin which can be found here.

Currently I've added

<script type="text/javascript">
    $(".wpcf7-form").submit(function(){
        var google_conversion_id = "12345678910";
        var google_conversion_label = "xxxxxxxxxxx";
        var image = new Image(1,1); 
        image.src = "http://www.googleadservices.com/pagead/conversion/"+google_conversion_id+"/?label="+google_conversion_label+"&script=0";
    });
</script>

to my footer, but it doesn't send correct results. Could someone help me out with what I should add to my Contact Form Plugin, through the control panel of WordPress, to make my Analytics show correct results. I would not prefer redirecting to another page.

解决方案

You are on right track. As this script runs you get your results recorded at server.

  1. The easiest and most common way to achieve this is to place the script on a separate page(generally a thank-you.php) and redirect user to that page so after completion of his activity we can run this script and record this activity. OR
  2. The other way(a tricky one though) is to make this script run on the same page using ajax/javascript after user's activity.

I have implemented the second one successfully on one of my client's website Hiteshi Technologies

If you want to set it without any redirection you may find this helpful.

Google Conversion Tracking Without Redirection

Cheers!!

这篇关于将Google转换代码添加到WordPress联系表单7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆