Use these steps for advanced cookie configuration options for Site Intercepts.
✅ Plan Availability: Essentials, Professional, International, and Premium
👥 User roles: Owner, Admins, and Researchers
For more information, see our article on how to find your plan and user role.
On this page:
- Site Intercept based on referrer URL
- Cookie name and value (Site Intercept)
- Cookie name and value (Permanent Site Intercept)
- Cookie domain
- Cookie expiration time
- Change stylesheet location
- Keep the focus on the Site Intercept when using tab (Accessibility)
Site Intercept based on referrer URL
You can trigger your Site Intercept based on the URL/domain visitors are coming from using this code:
try {
if( /domain\.(de|com)/.test(document.referrer) ) {
SITE INTERCEPT CODE HERE
}
}
catch(e) { }
Cookie name and value (Site Intercept)
Define the cookie name and value for a Site Intercept using this code:
<script type="text/javascript">//<![CDATA[
_uzactions = window._uzactions|| [];
_uzactions.push(['_setID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']);
_uzactions.push(['_setSID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']);
_uzactions.push(['_setCookie', 'XYZ']);
_uzactions.push(['_setValueCookie', 'XYZ']);
_uzactions.push(['_start']);
(function() {
var uz = document.createElement('script'); uz.type = 'text/javascript'; uz.async = true; uz.charset = 'utf-8';
uz.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn4.userzoom.com/trueintent/js/uz_til.js?cuid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uz, s);
})();
//]]></script>
Cookie name and value (Permanent Site Intercept)
Define the cookie name and value for a Permanent Site Intercept using this code:
<script type="text/javascript">//<![CDATA[
_uzactions = window._uzactions || [];
_uzactions.push(['_setCookie', 'XYZ']);
_uzactions.push(['_setValueCookie', 'XYZ']);
(function() {
var uz = document.createElement('script'); uz.type = 'text/javascript'; uz.async = true; uz.charset = 'utf-8';
uz.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn4.userzoom.com/files/js/XXXXXXXX.js?t=uz_til&cuid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uz, s);
})();
//]]></script>
Cookie domain
- You can change the domain of the cookie created when the Site Intercept appears.
- This stops the Site Intercept from triggering again in the defined domain and its subdomains.
- Use this code:
<script type="text/javascript">//<![CDATA[
_uzactions = window._uzactions|| [];
_uzactions.push(['_setID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']);
_uzactions.push(['_setSID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']);
_uzactions.push(['_setDomain', 'domain.com']);
_uzactions.push(['_start']);
(function() {
var uz = document.createElement('script'); uz.type = 'text/javascript'; uz.async = true; uz.charset = 'utf-8';
uz.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn4.userzoom.com/trueintent/js/uz_til.js?cuid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uz, s);
})();
//]]></script>
Cookie expiration time
- The default cookie expiration time to not intercept (invitation rate not 100%) is that the cookie gets deleted when the browser session ends.
- You can change the cookie's expiration time (in days) by adding the code below to the Site Intercept code before implementation.
- When setting the value to -1, the cookie is deleted as soon as the browser session ends.
- When adding a positive value, time is counted as the number of days until expiration.
- Use this code:
<script type="text/javascript">//<![CDATA[
_uzactions = window._uzactions|| [];
_uzactions.push(['_setID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']);
_uzactions.push(['_setSID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']);
_uzactions.push(['_setRatioCookie', -1]);
_uzactions.push(['_start']);
(function() {
var uz = document.createElement('script'); uz.type = 'text/javascript'; uz.async = true; uz.charset = 'utf-8';
uz.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn4.userzoom.com/trueintent/js/uz_til.js?cuid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uz, s);
})();
//]]></script>
Change stylesheet location
- By default, stylesheets (CSS files) are added to the Document Object Model (DOM) in the first page header ().
- This can be changed using this code:
<script type="text/javascript">//<![CDATA[
_uzactions = window._uzactions|| [];
_uzactions.push(['_setID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']);
_uzactions.push(['_setSID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']);
_uzactions.push(['_setElement', ‘body’]);
_uzactions.push(['_start']);
(function() {
var uz = document.createElement('script'); uz.type = 'text/javascript'; uz.async = true; uz.charset = 'utf-8';
uz.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn4.userzoom.com/trueintent/js/uz_til.js?cuid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uz, s);
})();
//]]></script>
Keep the focus on the Site Intercept when using tab (Accessibility)
- You can prevent elements outside of the Site Intercept from taking focus when participants use the tab key to navigate your webpage.
- Use this code:
<script type="text/javascript">//<![CDATA[
_uzactions = window._uzactions|| [];
_uzactions.push(['_setID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']);
_uzactions.push(['_setSID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']);
_uzactions.push(['_setTabRing', 1 ]);
_uzactions.push(['_start']);
(function() {
var uz = document.createElement('script'); uz.type = 'text/javascript'; uz.async = true; uz.charset = 'utf-8';
uz.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn4.userzoom.com/trueintent/js/uz_til.js?cuid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uz, s);
})();
//]]></script>
Please provide any feedback you have on this article. Your feedback will be used to improve the article and should take no more than 5 minutes to complete. Article evaluations will remain completely confidential unless you request a follow-up.