SOLVED

Is there a way to set "Referrer URL" and "Query Parameters" from payload?

Go to solution
Gabriel_Ortiz
Level 2

Is there a way to set "Referrer URL" and "Query Parameters" from payload?

Hey yall, i'm in a real pickle. So I need to send a payload to Marketo and i need to set the "Referrer URL". The site domain is coming through ie. example.com, but I need the full URL path, ie example.com/stuff/stuff. There are campaigns triggered on this URL, and it's not getting captured when I POST to Marketo. What would also be helpful is if anyone knows a reference where I can see all the object keys that marketo uses. This is what I've tried so far and nothing has been successful:

Also, does anyone know the query parameters key?

MktoForms2.whenReady(function(form){
form.addHiddenFields({
LastFormURL : document.location.href,
LastFormReferrer : document.referrer,
Referrer__c : document.referrer,
referrerURL : document.referrer,
Lead_Source_Details : document.referrer,
lastReferrerURL : document.referrer
});
}); ‍‍‍‍‍‍‍‍‍‍

For reference, this is the activity log:

referral url and stuff.png

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Is there a way to set "Referrer URL" and "Query Parameters" from payload?

_mktoReferrer is not the referring page. It's the page hosting the form. The name is misleading: it's only the "referrer" in the sense that the referrer of an embedded asset is the URL of the document itself.

You don't need to do anything with URL params. Add them as hidden fields set to AutoFill.  

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Is there a way to set "Referrer URL" from payload?

The referrer content is determined by *the referring site*. If they've set (via <meta referrer> tag) only the hostname to be sent, as is often the case when going from SSL to non-SSL sites, there is nothing, by definition, that you can do to read the full URL.

Gabriel_Ortiz
Level 2

Re: Is there a way to set "Referrer URL" and "Query Parameters" from payload?

Thanks Sanford Whiteman you are correct. I actually figured part of it out, by poring over Marketo forms2.js · GitHub  I found that `_mktoReferrer` will set the value in the Activity log.

However, the last step that remains is getting the "Query Parameters" with the UTM values. Do you have any thoughts on that?

The Gist inidicates theres a specific format for the query params:, or will Marketo do the query parsing on their end?

These values are super important because i guess all the campaigns are triggered from them.

SanfordWhiteman
Level 10 - Community Moderator

Re: Is there a way to set "Referrer URL" and "Query Parameters" from payload?

_mktoReferrer is not the referring page. It's the page hosting the form. The name is misleading: it's only the "referrer" in the sense that the referrer of an embedded asset is the URL of the document itself.

You don't need to do anything with URL params. Add them as hidden fields set to AutoFill.  

Gabriel_Ortiz
Level 2

Re: Is there a way to set "Referrer URL" and "Query Parameters" from payload?

Yep! right again! I'm glad to get this resolved. And you were right about the URL params, it parsed that automatically (thank god).

Lastly, are you aware of any special documentation that explains the key:vals in the marketo payload object? I foresee that other issues will come up where i need to send marketo special data, and it would be great to have a reference. I've gotten pretty far by observing the parameters visible through the console Network tab.

Thanks!!!

SanfordWhiteman
Level 10 - Community Moderator

Re: Is there a way to set "Referrer URL" and "Query Parameters" from payload?

Except for the special fields like _mktoReferrer it's just the SOAP field names and instance/form identifiers. There isn't anything mysterious really: formid, munchkinId, _mkt_trk, etc. are self-explanatory, no?