I'm planning on sending out 5-10 emails using Outlook. In this email, there will be a link to our website where a Marketo widget will appear. My question is - Is there any way to personalize the widget to display the person's name who clicked the link? For example, I send the email to someone named John. They click the link in the email to go to the website, and a widget appears saying, "Hello, John...".
I was thinking this might be possible using unique URLs for each person, but I'm not sure if that would be the best approach. Any help would be greatly appreciated!
It's a pop-up that appears after the home page loads. It has some text and a button that redirects the visitor to an info page about our services.
If you have no way of guaranteeing they already have an associated (i.e. not anonymous) session then clearly you have to embed the identifying information in the URL itself.
I'd recommend Base64-encoding their name as it'll look like gibberish to inexperienced users ("Ryan" is "?Unlhbg%3D%3D"). Then URI-decode and Base64-decode it and set the text on the widget.
For a very simple example, if the widget contents were like:
Hi there, <span data-field-echo="FirstName"></span>
and the document URL is
then the JS would be
document.querySelector("[data-field-echo='FirstName']").textContent = atob(decodeURIComponent(document.location.search.substring(1)));
Obviously the more complex the potential query params, the more precise the code needs to be. If you need more, don't try to write your own URL parser as you'll get it wrong (everyone does!). Use something like URI.js instead.