I'm using Pardot and I'm wondering if there's a way to pass someone's email address through a URL to allow Pardot to identify someone as a prospect as soon as they enter the site. I've found information about passing data to Pardot forms. What I want to do is pass the information directly to Pardot, even if someone doesn't fill out a form.
2 Answers
Besides that it is not seen as good practice, passing personally identifiable information in URLs, there is to my knowledge no possibility of identifying a prospect, who doesn't have a Pardot cookie, without this person having to fill out a form.
You most definitely can do this, but as mentioned, it breaches "good etiquette" of not passing that kind of information in a URL. You may be able to play some tricks with loading the page twice, or sending them through a small intermediate page, to make it so the visitor doesn't notice you put their email address right into the URL by the time they look at the URL bar ... but a web developer I worked with didn't have any luck with that when they tried it (Pardot needed longer than the first site was staying up).
But yes, the snippet of JavaScript that Pardot provides you and that you embed in all of your web site's pages that is responsible for setting a cookie on behalf of Pardot is also always "listening" for a "pi_email=SomeEmailAddress
" parameter. If that snippet of JavaScript finds such a URL parameter, it will call out to Pardot's servers and tell Pardot that the current "visitor ID" (as parsed from the cookie it assigns/uses) belongs to that email address.
Also, some JavaScript to extract the "visitor ID" from a cookie is:
function getPardotVisitorId() {
// Return the value of the first cookie found that starts with visitor_id. If none found, return an empty string.
var desiredPrefix = 'visitor_id';
var cookieArray = document.cookie.split(';');
for (var i=0; i<cookieArray.length; i++) {
var currentCookie = cookieArray[i];
// If the current cookie starts with a space, trim it off & overwrite the current cookie w/o the space.
while (currentCookie.charAt(0)==' ') currentCookie = currentCookie.substring(1);
// Test if currentCookie starts with the desired Prefix.
if (currentCookie.indexOf(desiredPrefix) == 0) {
// Now that we've found a cookie that starts with the Prefix, grab the rest of it.
cookieAfterPrefix = currentCookie.substring(desiredPrefix.length,currentCookie.length);
if (cookieAfterPrefix.split('=').length < 2) return '';
else return cookieAfterPrefix.split('=')[1];
}
}
return '';
}
If you want to come up with some sort of solution to your problem that involves getting the "visitor ID" back to your own servers (perhaps doing some calls against Pardot's API from there), rather than putting an email address into a URL parameter, that might be handy.
It adds a bit of clutter to your "Prospect Activities" log (although nothing you couldn't periodically manually comb the log for and delete using the Pardot REST API and a script) because it logs each hit to https://pi.pardot.com/analytics as a unique "Visit," but for such back-end operations without using the REST API (and the worrying about stored credentials that that entails), you can, once you know a visitor ID and an email address, associate them by doing a HTTP GET or POST to https://pi.pardot.com/analytics and giving it headers or parameters of:
ver=3
visitor_id=SomeVisitorId
campaign_id=something
(see your JavaScript from Pardot forpiCId
)account_id=something
(see your JavaScript from Pardot forpiAId
)[email protected]