Conversion Tracking with AJAX

If your site is using AJAX, then the traditional implementation of AdWords, YSM, MSN.

cdl_capture_2011-03-30-02_ 000

 

IFRAMES with Javascript:

function ppcconversion() {
var iframe = document.createElement('iframe');
iframe.style.width = '0px';
iframe.style.height = '0px';
document.body.appendChild(iframe);
iframe.src = 'http://www.yourdomain.com/path_to_file_with_code';
};

Join the Conversation

1 Comment

  1. http://stackoverflow.com/questions/5085132/inserting-google-adwords-conversion-tracking-with-javascript-or-jquery

    function matchResultsCallback(data){

    var scriptTag = document.createElement(‘script’);
    scriptTag.type = “text/javascript”;
    scriptTag.text = scriptTag.text + “/* */\n”;
    $(‘body’).append(scriptTag);

    $(‘body’).append(“”);
    //I have also tried this bit above using the same method as ‘scriptTag’ with no luck, this is just the most recent iteration.

    var scriptTag2 = document.createElement(‘noscript’);
    var imgTag = document.createElement(‘img’);
    imgTag.height = 1;
    imgTag.width = 1;
    imgTag.border = 0;
    imgTag.src = “http://www.googleadservices.com/pagead/conversion/993834405/?label=bSpUCOP9iAIQpevy2QM&guid=ON&script=0”;

    $(‘body’).append(scriptTag2);
    $(‘noscript’).append(imgTag);
    }

Leave a comment