Re: Adwords conversion tracking code on landing page without TY page

Eva_Yu
Level 3

Adwords conversion tracking code on landing page without TY page

I have read many posts on the site on this topic but still have not found the answer. I'm trying to add the adwords conversion tracking code to a landing page template.

Since we use the on-page thank you message, there is no follow-up page to embed the tracking code.

I'm using the second method to track the click action on the CTA button. The global site tag and event snippets are already in place (hopefully correct), but I don't know how to activate the code on the button.

We use guided landing page template and I only have basic knowledge of HTML. Is there any other simpler way to make it work?

Thanks!

The code on the template looks like so:

  <!-- BASIC INFO -->

    <title></title>

    <!-- GOOGLE FONTS -->

    <link rel="stylesheet" href="https://nation.marketo.com//fonts.googleapis.com/css?family=Montserrat:400,700">

    <link rel="stylesheet" href="https://nation.marketo.com//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800">

    <link rel="stylesheet" href="https://nation.marketo.com//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

   

   <!-- Global site tag (gtag.js) - Google Ads: 796654883 -->

<script async ></script>

<script>

  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag('js', new Date());

  gtag('config', 'AW-796654883');

</script>

   

    <!-- Event snippet for Download conversion page

In your html page, add the snippet and call gtag_report_conversion when someone clicks on the chosen link or button. -->

<script>

function gtag_report_conversion(url) {

  var callback = function () {

    if (typeof(url) != 'undefined') {

      window.location = url;

  }

  };

  gtag('event', 'conversion', {

      'send_to': 'AW-796654883/KEFpCOSJo4gBEKP67_sC',

      'event_callback': callback

  });

  return false;

}

</script>

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: Adwords conversion tracking code on landing page without TY page

Provide a link to your page.

Eva_Yu
Level 3

Re: Adwords conversion tracking code on landing page without TY page

Sahil_Kumar_Chh
Level 2

Re: Adwords conversion tracking code on landing page without TY page

Hi Eva,

Please try to run the script code on Onsucess Marketo form event.

Eva_Yu
Level 3

Re: Adwords conversion tracking code on landing page without TY page

Thanks Sahil for replying. But I'm not s developer and not sure how to do that.

SanfordWhiteman
Level 10 - Community Moderator

Re: Adwords conversion tracking code on landing page without TY page

You have to replace your existing onSuccess listener, because you already have custom behavior:

MktoForms2.whenReady(function (form){

  form.onSuccess(function(values, followUpUrl){

    /* replace form with confirmation text */

    form.getFormElem().hide();

    document.getElementById('confirmform').style.visibility = 'visible';

    /* log conversion to GA */

    gtag_report_conversion();

    /* do not redirect to followUpUrl */

    return false;

  });

});

However, I don't recommend this kind of one-off use of tracking pixels/functions. You should have a developer build this support into the LP template, with the ability to chain multiple tracking vendors (at some point, if you have an ad agency, you're going to need more than one) and to turn them on/off using mktoBoolean fields. It can rapidly become unmanageable.

Eva_Yu
Level 3

Re: Adwords conversion tracking code on landing page without TY page

Hi Sanford,

We are considering your suggestions on hiring am agency to implement multiple tracking codes on website and Marketo (google analytics, LinkedIn, multiple adwords etc.) Do you have any recommendation on a vendor?

Thanks!

SanfordWhiteman
Level 10 - Community Moderator

Re: Adwords conversion tracking code on landing page without TY page

I can't make any specific recommendations here. Just someone who's done this exact thing before -- ask for screenshots of past job or a proposal of exactly the switches will work.