DXM and Web Content Management
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Personalization and Targeting Knowledge Base

WCO: Targeting Group with Marketo Integration Steps

Create Connectors

First, let's create two connectors in WCO. One for sending data to Marketo and another one for SOAP API call.

Go to WCO (from left menu) > Settings > Settings tab > Global Settings > Manage Connectors

1) Select "Marketo API". In here you need to enter the SOAP API information from Marketo.

Marketo configuration values can be found in the Marketo admin portal. Go to Admin > Integration > Web Services, and copy Endpoint URL, User ID, and Encryption Key from the SOAP API section.

marketo_soap.png

 

2) Create a connector to send data to your Marketo form by clicking "Create New > [Connector Name]"

You will need to create a form in Marketo. Once you have it, enter the endpoint URL, formid, and munchkinId.

marketo_connector.png


Create a form in WCO Wyiswyg

Now, we need to create a form that we can submit to Marketo so later we can compare the value to target the user.

1) From a Wysiwyg that supports WCO create a new snippet > [Enter snippet name] > Save the asset

2) Click "Form" > "New Form" > Build a form > Insert new or existing field. Make sure the field names are same as Marketo form.

Important: create a hidden field with the name "_mkt_trk". We will use this field to track the user later.

hidden_field.png

3) Go to "Form Settings > Rules tab > [Select the marketo form connector] > Add Connector > Save and Insert Form". This will insert the form created from WCO into your Wysiwyg. You should see something like below.

marketo_form.png

4) Create a javascript code to copy _mkt_trk cookie generated from Marketo snippet into our WCO hidden field.

The idea is to send the tracking cookie to Marketo when the form is submitted.

Below is a sample.

function getCookie(cname) {
  var name = cname + "=";
  var decodedCookie = decodeURIComponent(document.cookie);
  var ca = decodedCookie.split(';');
  for(var i = 0; i <ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) == ' ') {
      c = c.substring(1);
    }
    if (c.indexOf(name) == 0) {
      return c.substring(name.length, c.length);
    }
  }
  return "";
}

function formSubmit(e) {
var $this = $(this);
var marketoCookie = encodeURIComponent(getCookie('_mkto_trk'));
if (marketoCookie != '') {
$this.find('input[name=_mkt_trk]').val(marketoCookie);
}
}


Create targeting from WCO Wysiwyg

1) From a Wysiwyg that supports WCO create a new snippet > [Enter snippet name] > Save the asset

2) Create a targeting group by doing "Add Targeting Variant > Create Targeting Group > New Group > Marketo (from New Field) > Edit".

Lead Key Type = Cookie (generated by the Munchkin Javascript)

Lead Key Value = _mkt_trk (this is the field we created while creating the form)

Marketo Field Name = Enter the Marketo field name that you want to compare. You can find a list of all Marketo fields to query in the Marketo admin portal, under Admin > Field Management > Export Field Names. Use the "SOAP API Name" column.

Comparison Value = The return value from Marketo you want to compare.

targeting_group.png

3) Enter a variant name and select the targeting group you just created.

targeting_variant.png

4) Enter different content for each variant, then save and publish the page.

targeting_content.png


Testing

To test, first submit the WCO form then go to the page that has targeting group. The content should change if the information submitted matches the rule created from targeting group.