Raj,
Thanks for the pointers. I looked briefly into using snippets, but it looks like those need to run on the Marketo landing page. I'd like a solution that could run on our site before loading the landing page.
It looks like there are functions in munchkin.js that retrieve a lead ID from a URL token. Is there any way of calling those directly?
To clarify our use case:
- all of our gated content is managed and served by our CMS (WordPress)
- when a user requests a gated asset, we use the Marketo API to look them up using getLead and the user's cookie
- if the user is not a known lead, or if their lead record is not complete, we load a Marketo landing page in an iframe.
This breaks down when previously uncookied users land on these asset pages from marketing emails.
I've found two partial solutions that might work:
- By the second page load (after munchkin.js runs once), these users can be be looked up by their cookies. I've considered adding an intermediate page, or at least delaying the API call until the munchkin script runs.
- I can pass the token parameter from the parent page to the landing page iframe, and get at least a prefilled form for these users.
The first is undesirable because it adds another couple seconds to an already slow user experience, and the second isn't ideal, because if we already know who someone is, I'd rather not make them confirm it at all.
I guess I'm just looking for a quicker way of identifying the user from the token. Do you have any suggestions?