Adding Action conversion pixel in Marketo forms

When settings up goals, you can define goals by reaching a url (Destination Goal) or by action conversion. In case the goal that you want to track doesn’t have a url. (i.e. “Thank you” page). You will need to add a pixel to the conversion button or “Thank you” Iframe.

In this post, we will explain how to add an action conversion pixel to a Marketo form or Iframe.

1. Go to the Goals tab and create New Goal. Choose Goal Type: Action Conversion

2016-12-28_1007

 

2. After clicking on the ‘Save’ button. You will see the pixel for this goal.

pixel

3. Copy the src of the pixel

4.   This is the Marketo script that you use today, you need to take this code and edit it with the pixel that is generated from the action conversion pixel.

mkt_form

4. Here is how the js code needs to be after adding the pixel to the Marketo form. Add your data instead of the orange text. Once it’s placed together on the page, we will be able to track visitors reaching the goal

<script src="//app-sj16.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_ID"></form>
MktoForms2.loadForm("//app-sjst.marketo.com", "000-UHP-000", ID, function(form) {
  form.onSuccess(function(values, followUpUrl) {
    form.getFormElem().hide();
    var trd_pixel = document.createElement("img");
    trd_pixel.setAttribute('src', 'https://prod.trendemon.com/apis/loadflame/pixel?user_id=...'); 
    return false;
  });
});