Re: Use querystring in Change Data Value flow step

Natali_Talevski
Level 4

Use querystring in Change Data Value flow step

Hi,

We have a campaign running at the moment where we are testing different ad creative. This is being picked up via UTM tags. I'm trying to create a smart campaign / trigger that says:

Form submitted = CampaignForm

AND Person created in past 24 hours

Then in the flow step something along the lines of:

IF Link contains utm_content=Promo1

Data change value Web Content = Promo1

Now, querystring isn't available as a selection, and web page contains only picks up the base URL and not the additional parameters. I can't add the field to the form as this will tag everyone who submits the form with the parameter (only leads generated from this creative should be tagged). My other option is to create a smart campaign for every single ad version, which is doable, but given we have almost 50 different versions, pretty time consuming.

Any ideas on how to do this?

Thanks!

8 REPLIES 8
SanfordWhiteman
Level 10 - Community Moderator

Re: Use querystring in Change Data Value flow step

The query string is not natively available as a token.

You can use this method (with the limitations noted) to pass the query string as part of the {{trigger.web page}} token. But this still isn't parsing the query string (i.e. you will not see the utm_content value alone).

For parsing on the server side, you need a webhook -- this is something we do a lot, like when an outside agency sets up rather opaque UTM params and we want to translate them into friendly names back on the lead.

But parsing is only necessary when you want to post data without a form. As you are using a form, I'm not convinced you can't do this using standard hidden UTM fields and spare yourself the complexity of server-side parsing. Why not add the field to the form, but just empty the value (using Forms JS) if it isn't "Promo1" (or any other interesting value):

MktoForms2.whenReady(function(form){

  // list your interesting values for certain fields

  // non-interesting values will be removed

  var interestingValues = {

      "utm_content" : ["Promo1","another value"]

  };

  /* --- NO NEED TO EDIT BELOW THIS LINE! --- */

 

  form.onSubmit(function(form){

    var currentValues = form.getValues();

 

    Object

    .keys(interestingValues)

    .filter(function(field){

      return !interestingValues[field].some(function(value){

        return value === currentValues[field];

      });

    })

    .forEach(function(field){

       var mktoFormData = {};

       mktoFormData[field] = "";

       form.setValues(mktoFormData);

     });

  });

});

Gerard_Donnell4
Level 10

Re: Use querystring in Change Data Value flow step

Hi @Natali,

In the flow step tab can you not just add a wait step of a few minutes at the very start to give the system time to update the utm_content field and then do a check of that field.

Change data value

if UTM_Content = promo1

Screen Shot 2018-01-23 at 16.52.26.png

Thanks,

Gerard

SanfordWhiteman
Level 10 - Community Moderator

Re: Use querystring in Change Data Value flow step

You don't need a wait step. If you're using a hidden field, the data value changes immediately.

But this isn't the same as skipping the data value update as the Forms JS above does. If you don't prevent the data from changing/being set in the first place, then you'll overwrite the existing value, and then empty the field.

Gerard_Donnell4
Level 10

Re: Use querystring in Change Data Value flow step

Thanks for the info Sanford Whiteman​. I didn't know the data would populate before the trigger fired unless there was a wait step in place.

Is it me, or is utm parameters not being present at the program level a major flaw? I feel this should exist specifically for the reason that the value currently gets constantly overwritten at the lead level.

Natali_Talevski
Level 4

Re: Use querystring in Change Data Value flow step

Thanks for the help. As I mentioned, I can't put the field as a hidden field on the form as I only want this to be populated for nett new leads, and not everyone who submits the form. Gerard Donnelly​ - UTM Content isn't a field in Marketo, so you cannot use it in the flow step as suggested.

My biggest issue is the web page activity doesn't include anything past the base URL within the URL name, and instead passes it to the query string section, which is only a constraint on the filter/trigger and not available in a flow step. It looks like the workaround to pass the query string as part of the web page trigger might work, as essentially what I'm trying to do is have a flow step that says "If web page contains utm_content=Promo1, then update Field with Promo1. I'll give it a go and see what happens.

Thanks again!

SanfordWhiteman
Level 10 - Community Moderator

Re: Use querystring in Change Data Value flow step

As I mentioned, I can't put the field as a hidden field on the form as I only want this to be populated for nett new leads, and not everyone who submits the form.

I thought above you said it has to be populated only for people who submit with this particular utm_content value, not net new leads.

My biggest issue is the web page activity doesn't include anything past the base URL within the URL name, and instead passes it to the query string section, which is only a constraint on the filter/trigger and not available in a flow step. It looks like the workaround to pass the query string as part of the web page trigger might work, as essentially what I'm trying to do is have a flow step that says "If web page contains utm_content=Promo1, then update Field with Promo1. I'll give it a go and see what happens.

That won't select only net new leads any more than the Forms JS method will (and the Forms JS is more reliable).

Natali_Talevski
Level 4

Re: Use querystring in Change Data Value flow step

The UTM is on our ads, and they are targeting existing contacts as well as nett new. So existing prospects and customers will also be submitting the form.

I just had a thought - I can embed a form within a form. Make one for unknown leads with the UTM collected as a hidden field. Then in the settings, add the second form for if a known lead hits the page, and this second form won't have the UTM captured. Might still get a few existing prospects who have blocked/cleared cookies, but they would be easy to identify rather than trying to review everyone who submits.

SanfordWhiteman
Level 10 - Community Moderator

Re: Use querystring in Change Data Value flow step

The UTM is on our ads, and they are targeting existing contacts as well as nett new. So existing prospects and customers will also be submitting the form.

So store the value in a temporary field. If the lead is new (detected on the Marketo server) then copy the value to the real field.

Make one for unknown leads with the UTM collected as a hidden field. Then in the settings, add the second form for if a known lead hits the page, and this second form won't have the UTM captured. Might still get a few existing prospects who have blocked/cleared cookies, but they would be easy to identify rather than trying to review everyone who submits.

You cannot know if someone is a known lead on the browser side if they are using a different device, browser, or browser session.  I would not use this method to screen "net new" leads -- it'll be wildly inaccurate. Only on the server can you get an accurate read of whether someone was merged or new.