Managing Cookie Policies with ViaAds
ViaAds respects user cookie choices. If your website allows users to browse products without first accepting a cookie policy or lets them customize cookie types (necessary, functional, statistical, and marketing), you need to inform ViaAds about the cookie preferences.
CMS Specific Procedures
Procedures vary based on your CMS. Each CMS has a dedicated section below:
WooCommerce
The main script is integrated into the plugin for convenience. Below are two script versions. The difference is in the first two lines of the second version, enabling the feature to notify us when to stop tracking a customer.
Implementing Scripts
Version 1: Basic Implementation
<script>
(function() {
var o = document.createElement('script');
o.type = 'text/javascript';
o.async = true;
o.src = 'https://files.viaads.dk/plugins/min/danDomain.min.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(o, s);
})();
</script>
<script>
(function() {
window.viaadsOptions = window.viaadsOptions || [];
window.viaadsOptions.push({'tracking.cookiesEnabled': true});
var o = document.createElement('script');
o.type = 'text/javascript';
o.async = true;
o.src = 'https://files.viaads.dk/plugins/min/wooCommerce.min.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(o, s);
})();
</script>
Updating Cookie Preferences:
When the user enables cookies, update the tracking.cookiesEnabled value:
window.viaadsOptions.push({'tracking.cookiesEnabled': true});
Note: never overwrite window.viaadsOptions with a new array after the ViaAds script ran – always use the push method to update values!
DanDomain
Integrating ViaAds into your DanDomain CMS enhances your ability to respect user preferences while optimizing user engagement. The provided script allows for seamless automatic behavior tracking, enabling you to understand customer interactions and adjust your strategies accordingly.
<script>
(function() {
var o = document.createElement('script');
o.type = 'text/javascript';
o.async = true;
o.src = 'https://files.viaads.dk/plugins/min/danDomain.min.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(o, s);
})();
</script>
DanDomain Classic
Description Here
Automatic Customer Behavior Tracking
The following script allows for automatic behavior tracking of visiting customers.
<script>
(function() {
var o = document.createElement('script');
o.type = 'text/javascript';
o.async = true;
o.src = 'https://files.viaads.dk/plugins/min/danDomainClassic.min.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(o, s);
})();
</script>