SOLVED

Re: Updating First Touch Acquisition based off UTM Paramaters

Go to solution
Troy_Larson
Level 4

Updating First Touch Acquisition based off UTM Paramaters

Hey fellow marketo people - 

 

I have a question for you guys. I'm not sure if this has been addressed somewhere else here (if that's the case could someone help me find that page/article?)

 

So basically, I'm having a hard time thinking through how to stamp a field. We have an SFDC field that stamps first touch attribution -- we call it, Lead Source Detail. Lead Source Detail records the campaign name of the acquisition of a specific person.

 

I've added this as a hidden field to all our forms and populate the value as a token. (so we don't worry about having to add it in on flow steps). 

 

Now, my question: I have a white paper page with a Lead Source Detail of WP-2020-White Paper. I have a 3rd part sending traffic to that page. Their URL has UTM parameters in it. However, I am looking to stamp net new people's Lead Source Detail with a slight variation. Instead of "WP-2020-White Paper" I'd like to stamp it as "ADV-WP-2020-White Paper" - that way I know from looking up that field that the person was acquire via an ad vs organically via the white paper. 

 

The only solution I could think of was a cloned white paper program and sending traffic to that page. That way the Lead Source Detail (if blank, upon submission) could be updated to the "ADV-WP-2020-White Paper". 

 

Was wondering though if there was a more straightforward way to leverage the UTMs maybe and not have to clone my program to achieve the same result. For example, maybe my underling config isn't set up to really achieve this or just looking for any thoughts/ideas here. 


Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Updating First Touch Acquisition based off UTM Paramaters


Thanks again for trying to decode what it is I'm trying to do here 🙂  You were right there. So if I wanted to prepend say "ADV" in front of a value on hidden field if they submitted it with a specific URL query-string I could do that? 


For example, prepend "ADV" if you filled out a form with utm_source=linkedin - that's possible using JS, do I have that right?


Sure. Use the built-in query param parser to get "linkedin" into a hidden field like Most Recent UTM Source (you're probably already doing this).

 

Then use the possible values of that hidden field to manage the final value of Lead Source.

 

To the tune of:

MktoForms2.whenReady(function(mktoForm){
  let currentValues = mktoForm.getValues();
  
  let mktoFields = {
    "utm_source" : "MostRecentUTMSource",
    "lead_source" : "LeadSource"
  };
  
  let prefixBySource = {
    "linkedin" : "ADV",
    "google" : "SRCH"
  };
  
  let newValues = {};
  if( currentValues[mktoFields.lead_source] in prefixBySource ) {
    newValues[mktoFields.lead_source] = prefixBySource[currentValues[mktoFields.lead_source]] + "-" + 
      currentValues[mktoFields.lead_source];
    mktoForm.addHiddenFields(newValues);
  }
});  

 

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Updating First Touch Acquisition based off UTM Paramaters

Not sure exactly what you're going for, but if you want to prepend information to the hidden field value based on a UTM value, that's easy using JS — but you have to use JS, there's no codeless way.

Troy_Larson
Level 4

Re: Updating First Touch Acquisition based off UTM Paramaters

Hey @SanfordWhiteman -

 

Thanks again for trying to decode what it is I'm trying to do here 🙂  You were right there. So if I wanted to prepend say "ADV" in front of a value on hidden field if they submitted it with a specific URL query-string I could do that? 


For example, prepend "ADV" if you filled out a form with utm_source=linkedin - that's possible using JS, do I have that right?

SanfordWhiteman
Level 10 - Community Moderator

Re: Updating First Touch Acquisition based off UTM Paramaters


Thanks again for trying to decode what it is I'm trying to do here 🙂  You were right there. So if I wanted to prepend say "ADV" in front of a value on hidden field if they submitted it with a specific URL query-string I could do that? 


For example, prepend "ADV" if you filled out a form with utm_source=linkedin - that's possible using JS, do I have that right?


Sure. Use the built-in query param parser to get "linkedin" into a hidden field like Most Recent UTM Source (you're probably already doing this).

 

Then use the possible values of that hidden field to manage the final value of Lead Source.

 

To the tune of:

MktoForms2.whenReady(function(mktoForm){
  let currentValues = mktoForm.getValues();
  
  let mktoFields = {
    "utm_source" : "MostRecentUTMSource",
    "lead_source" : "LeadSource"
  };
  
  let prefixBySource = {
    "linkedin" : "ADV",
    "google" : "SRCH"
  };
  
  let newValues = {};
  if( currentValues[mktoFields.lead_source] in prefixBySource ) {
    newValues[mktoFields.lead_source] = prefixBySource[currentValues[mktoFields.lead_source]] + "-" + 
      currentValues[mktoFields.lead_source];
    mktoForm.addHiddenFields(newValues);
  }
});