Adwords / Facebook Conversion Tracking Without Thank You Page

Anonymous
Not applicable

Adwords / Facebook Conversion Tracking Without Thank You Page

Hello,

Our designers have come up with the following landing page: What We Do | Marketing Solutions

If you click on contact us, you have a slide in panel with an embedded Marketo form, which uses an onSuccess handler to stay on the same page and load additional content after the user submits the form.

Since there is no thank you page, I was wondering how to implement Adwords and Facebook conversion tracking. The onSuccess handler currently implemented looks like this:

<script>
  MktoForms2.whenReady(function (form){
  //Add an onSuccess handler
  form.onSuccess(function(values, followUpUrl){
  //get the form's jQuery element and hide it
  form.getFormElem().hide();
  document.getElementById('confirmform').style.display= 'block';
  document.getElementById('FormINT').style.display= 'none';
  //return false to prevent the submission handler from taking the lead to the follow up url.
  return false;
  });
  });
   </script>

I was thinking of implementeing it this way: Asynchronous AdWords Remarketing Tag  |  AdWords Remarketing Tag  |  Google Developers  but not sure where to put it, or what the syntax would look like.

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Adwords / Facebook Conversion Tracking Without Thank You Page

[Remember to post to Products/DIscussions.]

John, you already are almost there as you have an onSuccess listener.  Add the basic code (under "Programmatically >> Standard JS") in there.  Note that there is a slim (but not quite nonexistent) possibility of a missed hit if the tracking pixel doesn't finish requesting before the user switches pages.

janerusnak
Level 2

Re: Adwords / Facebook Conversion Tracking Without Thank You Page

Hi Sanford, 

 

I used this post to set up on page Linkedin tracking on successful form submission when there is no thank you page, but I can't figure out what to use to do the same for Facebook. Could you please point me in the right direction?
This is how my current form looks like:

 

MktoForms2.whenReady(function (form){

  //Add an onSuccess handler
  var liPixelsrc="https://px.ads.linkedin.com/collect/?pid=xxx&conversionId=xxx&fmt=gif";

   form.onSuccess(function(values, followUpUrl){

    //get the form's jQuery element and hide it
    
    var liPixel = new Image();
    liPixel.src=liPixelSrc;

    form.getFormElem().hide();

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

    //return false to prevent the submission handler from taking the lead to the follow up url.

    return false;

  });

});
  

</script>

<div id="confirmform" style="visibility:hidden; font-family: overpass; font-size: 16px; color: #03BA5B; text-align: center;"><p><strong>Thank you for joining us! Check your email for details on your request.</strong.</p></div></script>​

 

 

 




Looking to spend wisely at your company? Check out procurify.com
SanfordWhiteman
Level 10 - Community Moderator

Re: Adwords / Facebook Conversion Tracking Without Thank You Page

You want to run a programmatic Facebook conversion in the onSuccess.