Adwords conversion tracking code on landing page without TY page | Community
Skip to main content
Eva_Yu
Level 3
September 5, 2018
Question

Adwords conversion tracking code on landing page without TY page

  • September 5, 2018
  • 2 replies
  • 6876 views

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>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

SanfordWhiteman
Level 10
September 5, 2018

Provide a link to your page.

Eva_Yu
Eva_YuAuthor
Level 3
September 5, 2018
Sahil_Kumar_Chh
Level 2
September 11, 2018

Hi Eva,

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

Eva_Yu
Eva_YuAuthor
Level 3
September 11, 2018

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

SanfordWhiteman
Level 10
September 12, 2018

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.