Hi There, new to board.
We have marketo embed forms on our site (via CMS, e.g. AEM or SiteCore) and we'd like to track the {{lead.ID}} when the user submits the form. The thank you pages are not Marketo templates but I have read on these boards that it is possible to return the {{lead.ID}} via JS on a non Marketo templated page, using Marketo embed forms.
I've tried a few times with no luck.
Example below doesn't seem to fetch the lead.ID
$(document).ready(function(){
var test = "{{lead.ID}}";
window.decodedVariable = $('<textarea/>').html(test).text();
Does anyone have any guidance around this. The purpose of tracking lead.id is for Analytics purposes.
Thanks in advance & Kind Regards
Solved! Go to Solution.
The thank you pages are not Marketo templates but I have read on these boards that it is possible to return the {{lead.ID}} via JS on a non Marketo templated page, using Marketo embed forms.
This is definitely incorrect out-of-the-box, don't know where you read it.
If (but only if) you use my separate form Pre-Fill JS you'll be able to read the field from your non-Marketo origin.
Note the Lead ID is numeric. There's no need to HTML-decode it, as it's not possible for it to contain characters requiring encoding in the first place.
The thank you pages are not Marketo templates but I have read on these boards that it is possible to return the {{lead.ID}} via JS on a non Marketo templated page, using Marketo embed forms.
This is definitely incorrect out-of-the-box, don't know where you read it.
If (but only if) you use my separate form Pre-Fill JS you'll be able to read the field from your non-Marketo origin.
Note the Lead ID is numeric. There's no need to HTML-decode it, as it's not possible for it to contain characters requiring encoding in the first place.