开发者

Ajax form and google conversions - the tricky part

开发者 https://www.devze.com 2023-03-25 22:28 出处:网络
For 2 weeks now i have tried to impliment the google conversion code to one of my ajax form landing page.

For 2 weeks now i have tried to impliment the google conversion code to one of my ajax form landing page.

what i had in the ajax after success is

var google_conversion_id = **MYID**;
var google_conversion_language = "iw";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "**MYLABEL**";
var google_conversion_value = 0;
$.getScript( "http://www.googleadservices.com/pagead/conversion.js" );

i just didn't work. in firebug i could have seen the js开发者_开发知识库 loads after filling the form but no conversion on the page

now what i have ending up doing is adding iframe - hidden, to the success message after the ajax.

this is working but for me is not the right way i wanted to do it

can anyone confirm my code is ok, or help understanding way it didn't work?


I got it to work using a dirty hack.

document.write = function(text) {
    $('#footer').append(text);
};        
$.getScript( "http://www.googleadservices.com/pagead/conversion.js" );

This is not ideal but it works for me until they remove the document.write from their script.


The current version of google adwords snippet uses document.write (see line 14 of conversion.js) which does not work after your page is loaded. The way I solved my problem is to use an iframe as what you did.

Here are more discussions.

http://groups.google.com/group/adwords-help-advanced/browse_thread/thread/2ef3ee7dc5863e86?pli=1

0

精彩评论

暂无评论...
验证码 换一张
取 消