There are a lot of different use cases for why you may want to capture an email from the URL parameter as a lead in Spotlightr.

If you are able to forward an email to the URL of the page on which you have a Spotlightr video with an Opt-in Lock, you can send that email directly to the Spotlightr opt-in, using the Spotlightr JavaScript API. Here's how you accomplish that.

Setting up your Opt-in lock

All you need to do is add any opt-in lock to the video which you will embed on the page where the email parameter will be available.

Setting up your page

After you've made sure that the email parameter is available in the URL, you will add the following code below your Spotlightr embed code.

All you need to do after that is to replace the myId = "YOUR_VIDEO_ID_HERE";

var myId='NDc3Mjc=';
var domainRef = (window.location != window.parent.location) ? document.referrer : document.location.href;
var regex = /[?&]([^=#]+)=([^&#]*)/g,
url = domainRef,
params = {},
while(match = regex.exec(url)) {
params[match[1]] = match[2];
document.addEventListener('vooPlayerReady', vooPlayerReadyFunction, false);
function vooPlayerReadyFunction(event){
if( &&{
vooAPI(myId, 'completeOptin', [, false]);

Auto-complete or pre-fill?

The code above makes sure that the opt-in is auto-completed and never shown to the user, by passing the parameter true together with the email

You may change the last parameter in the vooAPI function to false which will simply pre-fill the optin with the captured email, so that way the opt-in will be shown, but the user will still have to confirm opting in.

Did this answer your question?