页面在Google Adwords转化跟踪上被重定向

编程入门 行业动态 更新时间:2024-10-26 06:31:02
本文介绍了页面在Google Adwords转化跟踪上被重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经形成了人们提交数据并使用ajax将数据发送到服务器的表单.我已将其设置为Google Adwords中的转换.下面是我使用的代码.

I've form where people submit data and the data is sent to the server using ajax. I've setup this as a conversion in Google Adwords. Below is the code that I've used.

问题是,当用户提交表单时,获得响应后,其重定向回我给出的URL.我不想重定向!

The problem is, when a user submits the form, after getting the response, its redirected back to URL that I've given. I don't want to redirect!!

(由于此项目在VueJS中,因此提交的数据使用Vue资源)

(Data submitted is using Vue-resource since this project is in VueJS)

submit() { let self = this this.$validator.validateAll().then(success => { if (!success) { return; } document.getElementById("submitQuote").value = "Submitting..."; this.$http.post(store.state.url+'api/submit_quote.php', { formData: store.state.formData }) .then(response => { console.log(response.data) this.submitted = true self.reference_id = response.data goog_report_conversion('www.example/') //report Google that a conversion has occured }); }); }

Google提供的代码

Code given by Google

<!-- Google Code for Add to Cart Conversion Page In your html page, add the snippet and call goog_report_conversion when someone clicks on the chosen link or button. --> <script type="text/javascript"> /* <![CDATA[ */ goog_snippet_vars = function() { var w = window; w.google_conversion_id = 12345678; w.google_conversion_label = "abcDeFGHIJklmN0PQ"; w.google_conversion_value = 13.00; w.google_conversion_currency = "USD"; w.google_remarketing_only = false; } // DO NOT CHANGE THE CODE BELOW. goog_report_conversion = function(url) { goog_snippet_vars(); window.google_conversion_format = "3"; var opt = new Object(); opt.onload_callback = function() { if (typeof(url) != 'undefined') { window.location = url; } } var conv_handler = window['google_trackConversion']; if (typeof(conv_handler) == 'function') { conv_handler(opt); } } /* ]]> */ </script> <script type="text/javascript" src="//www.googleadservices/pagead/conversion_async.js"> </script>                                                  

推荐答案

仅不提供指向goog_report_conversion的重定向URL,即,不带参数就调用它.

Just don't provide a redirect URL to goog_report_conversion, i.e. call it without parameters.

重定向是有条件的:

if (typeof(url) != 'undefined') { window.location = url; }

更多推荐

页面在Google Adwords转化跟踪上被重定向

本文发布于:2023-11-02 08:02:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551828.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   页面   Google   Adwords

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!