Spotlightr includes an email capture gate feature, also called an opt-in lock, that requires the viewer to enter their email address in order to continue with the video. Or said in another way, they must "opt-in" to your mailing list in order to continue with the video.
This feature is a great way to share valuable video content and gather leads who are interested in this content. You can require them to opt-in to your list to view the video and promise them more videos, reports, or whatever you'd like a part of that opt-in process.
The issue some may run into is that you don't want these videos locked for viewers that are already part of your mailing list. You want them to be able to view these locked/gated videos without having to enter their email again.
We have a solution for this...
If you are able to forward/add their email address as a parameter in the URL of the gated video page, then this will bypass the gate and the viewer will be able to watch the video without having to opt-in again. You will be using the Spotlightr JavaScript API to send their email to that gate and bypass it.
Setting up your Opt-in lock
If you don't have a gated video yet, check this article to see how it's done.
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.
This is using the JS API.
All you need to do after that is to replace the myId = "YOUR_VIDEO_ID_HERE";
<script>
var myId='YOUR_VIDEO_ID_HERE';
var domainRef = (window.location != window.parent.location) ? document.referrer : document.location.href;
var regex = /[?&]([^=#]+)=([^&#]*)/g,
url = domainRef,
params = {},
match;
while(match = regex.exec(url)) {
params[match[1]] = match[2];
}
document.addEventListener('vooPlayerReady', vooPlayerReadyFunction, false);
function vooPlayerReadyFunction(event){
if(event.detail.video==myId && params.email){
vooAPI(myId, 'completeOptin', [params.email, false]);
}}
</script>
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.