I've build a non-trackable landing page template that includes the following code:
<!-- CREATE EMPTY MUNCHKIN COOKIE - TO ESENTIALLY MAKE THE PAGE UNTRACKABLE -->
<script>document.cookie = "_mkto_trk=;path=/;domain="+window.location.host+";expires=0"</script>
<!-- END -->
<!-- Clear the Marketo tracking cookie value on submission of the form, without having to delete the cookie itself from the user’s browser. -->
<script>
//add a callback to the first ready form on the page
MktoForms2.whenReady( function(form){
//add the tracking field to be submitted
form.addHiddenFields({"_mkt_trk":""});
//clear the value during the onSubmit event to prevent tracking association
form.onSubmit( function(form){
form.vals({"_mkt_trk":""});
})
})
</script>
<!-- END -->
I then use this template to build a landing page with a form where no tracking or identification should occur (this page will be used internally to approve/deny event registrants). Yet when I visit the page, all of the pre-fill fields are auto-populated with my name. Am I forgetting another piece of code?
Thx Dan,
I still have a error in the code on the "MktoForms2.whenReady( function(form)" line : Uncaught ReferenceError : MktoForms2 is not defined.
I m using a guide LP. The page is here : inficiences
Thx for any help 🙂
-Greg
Now that I look more closely at our pages, we're getting the same error. This is the standard code that both Sanford Whiteman and Kenny Elkington have shared.
window.location.host is the FQHN of the current page that appears in your browser's location bar.
In other words, for the Community site, nation.marketo.com. You want to clear cookies that apply to the parent and all subdomains: .marketo,com.
I'm not sure I'm following exactly. Here's the landing page:
What changes are needed in the above code?
Can't see the source from my mobile, but you probably want to replace
document.location.host
with
'.avanade.com'
Note that the quotation marks _are_ included.
That fixed it, Sanford, thanks!