Contents

Create API key in DanDomain

Implementation of ViaAds Scripts in DanDomain

Implementation of a Order Created Webhook for ViaAds

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>
Version 2: With Manual Consent Management
<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>
The second version is activated when the checkbox is checked on the ViaAds Plugin Configuration page. Upon loading, the ViaAds script will check window.viaadsOptions. If tracking.cookiesEnabled is set to false, initialization of cookie-dependent features will be deferred.

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>
In case of you wanting to manage to Cookie Policy yourself - see here for more.

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>