Skip to main content
July 16, 2015
Question

How do I check to see if a cookie is present to specific Marketo ID?

I am embedding a form onto an external website, and there is a button to a form within a modal dialogue to download a PDF. However, if the user is known, and already has '_mkto_trk' cookie (for a particular client), I want to bypass the form and go straight to the PDF. So far I have this, but to no avail! Also, surely the visitor could have the cookie from another marketo user, so unsure of how to grab the ID.

  $('.dl-btn').click(function(event) {

  if (jQuery.cookie('_mkto_trk')) {

      window.location = URL

    } else {

Any help is much appreciated!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

Kenny_Elkington
Adobe Employee
Adobe Employee
July 16, 2015

Hi Kris,

The presence of the cookie does not imply that a lead is known.  I'd suggest using this method instead: Show Custom HTML Form for Known Leads - Marketo Docs - Product Docs

Translate
July 17, 2015

Hi Kenny, thats great thank you. Is there any way of checking the cookie to see if the lead is known and then redirecting?

Translate
Kenny_Elkington
Adobe Employee
Adobe Employee
July 17, 2015

Sure.  In the custom HTML, you could set up a redirect with javascript.  Something like this:

<script>

document.location.href = "www.example.com"

</script>

Translate