How to Tag Your Video Viewers in Your CRM or Email Platform Via Embed Code (Advanced)
Tagging is not available on the Free plan, to gain access you will need to upgrade to any of our paid plans!
This is an advanced setup and requires JavaScript coding skills and the ability to pass a unique identifier (e.g. email, contact ID, etc.) to our player from your opt-in form to our player. If our player cannot read the parameters sent, it won't be able to tag your viewers. We would recommend getting a developer to do this method.
If you are trying to achieve this in ClickFunnels, go here instead.
Video tags can be triggered at any specific time during video playback. This is a very powerful feature that can be used in many ways.
Examples:
- You can send an email to the user if he watched the video until the end (keep in mind a good practice - set the video tag time about 10 seconds before the end instead of the last second)
- You can add the user to a specific e-mail campaign after he reaches some point in the video.
This is for all cases where passing param via URL is not possible or just not acceptable (like when using a landing page builder).
- Go to your video settings, create your Video Tag and grab trigger ID.
- Confirm your changes by clicking the "Publish" button on the top-right corner.
- Now it’s time to customize your embed code. You can grab the default one by clicking on the "Embed / Share" button.
- To override the default Vidalytics Player settings and pass your trigger ID values, you need to create a custom JavaScript object and then pass it to the embed code. It must have the following structure:
var vidalyticsCustomSettings = {
triggers: {
items: {
"XXXXXXXXXXXXX": { // replace "XXXXXXXXXXXXX" with your trigger ID
params: {
email: 'Email value here'
}
}
}
}
};
The Trigger ID + set param names should match the ones set in the Vidalytics dashboard, and you should set their values in the custom piece of JS above.
- Then, replace a small part of the embed code.
t.run(a)
has to be replaced witht.run(a, vidalyticsCustomSettings)
. - Your final customized embed code with the video tag field values should be similar to this:
- You can now install this code on your site. Watch the video on your site until your tag is fired to push some test data to Zapier.
It is important to do at least one test before going to Zapier. Without it, Zapier would not discover your video tag field setup.
Here is a sample of what your final code will look like. Feel free to use it, but make sure you change the trigger ID and general embed script with your own so it works properly!
<script type="text/javascript">
var vidalyticsCustomSettings = {
triggers: {
items: {
"XXXXXXXXXXXXX": { // replace "XXXXXXXXXXXXX" with your trigger ID
params: {
email: 'Email value here'
}
}
}
}
};
</script>
<div id="vidalytics_embed_[EMBED_ID]" style="width: 100%; position:relative; padding-top: 56.25%;"></div>
<script type="text/javascript">
(function (v, i, d, a, l, y, t, c, s) {
y='_'+d.toLowerCase();c=d+'L';if(!v[d]){v[d]={};}if(!v[c]){v[c]={};}if(!v[y]){v[y]={};}var vl='Loader',vli=v[y][vl],vsl=v[c][vl + 'Script'],vlf=v[c][vl + 'Loaded'],ve='Embed';
if (!vsl){vsl=function(u,cb){
if(t){cb();return;}s=i.createElement("script");s.type="text/javascript";s.async=1;s.src=u;
if(s.readyState){s.onreadystatechange=function(){if(s.readyState==="loaded"||s.readyState=="complete"){s.onreadystatechange=null;vlf=1;cb();}};}else{s.onload=function(){vlf=1;cb();};}
i.getElementsByTagName("head")[0].appendChild(s);
};}
vsl(l+'loader.min.js',function(){if(!vli){var vlc=v[c][vl];vli=new vlc();}vli.loadScript(l+'player.min.js',function(){var vec=v[d][ve];t=new vec();t.run(a, vidalyticsCustomSettings);});});
})(window, document, 'Vidalytics', 'vidalytics_embed_[EMBED_ID]', 'https://fast.vidalytics.com/embeds/[USER_ID]/[EMBED_ID]/');
</script>
To test your Zaps, you can use emails with +
signs, but they should be written as %2B
if you are simply appending
the email address on your URL for testing purposes.
To add multiple tags, you will need to add a comma before every new ID as shown below:
The field tag is something you need to get from your CRM. It must match identically to what your CRM calls it (e.g. if they call
it contact_id
you must put that into our system exactly). You may be able to choose from more than one field over there,
but it must be unique. The typical ones are email address (only one person can have the same email address) and contact id
(or some variation of what your CRM calls contact id).
For a simpler method via URL Parameter, check out this article: How to Tag Your Video Viewers in Your CRM or Email Platform Via URL Parameter
To set up your Zap in Zapier, check out this article: How to Set Up the Zapier Integration