How to set {{lead.ID}} to return on Form Complete or Submit on Web Page using Marketo Embed Form
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