google Adwords conversion script

前端 未结 4 1516

I have a form, that after submit the form I want to run the script of google Adwords conversion.

I\'m using ajax and jQuery:

var dataString = \'name=         


        
4条回答
  •  迷失自我
    2020-12-31 21:47

    I just send off the pixel request myself. Something like the following works for me:

    var img = document.createElement("img");
    var goalId = 123456;
    var randomNum = new Date().getMilliseconds();
    var value = 100;
    var label = "label";
    var url = encodeURI(location.href);
    
    var trackUrl = "http://www.googleadservices.com/pagead/conversion/"+goalId+"/?random="+randomNum+"&value="+value+"&label="+label+"&guid=ON&script=0&url="+url;
    img.src = trackUrl;
    document.body.appendChild(img);
    

    That at least registers the conversion, but I'm not sure if there are any issues becuase the actual tracking script isn't loaded.

提交回复
热议问题