1. Home
  2. VaultPro SDK
  3. Vaultpro SDK for Website

Vaultpro SDK for Website

VaultPro SDK for websites is a powerful single line integration. It tackles an important requirement presented by Intelligent Tracking Prevention 2.0 spec listed here ITP2.0.  

The track.js library is a JavaScript library for measuring engagement/conversion with your website and to measure your offer’s performance.

NOTE: If your website is already using an attribution SDK that supports ITP2.0, then you do NOT need to proceed with this integration

This document covers both the functional and technical requirements to implement the SDK into any website. It outlines the functional, performance, security and other system requirements.

Integrating the SDK

The process involves:

1. SDK tag will be found in offer details section -> Tracking URL tab of the Advertiser panel.

2. Copy the code snippet and place it anywhere within the <HEAD> ______ </HEAD> tags of your website.

Syntax

<script async defer src="https://Client#ID.cloudfront.net/track.min.js" onload="VaultSDK.init(macro_name)"/>

Note: macro_name: Name of the macro in which tracking id is delivered to SDK, This will be same as entered in tacking url against “transaction_id” value. Do not change this.

Key Functions:

1. Identify Pages

The Page function allows you to record page views on your website. VaultPro SDK will automatically collect the page information from the page URL.

2. Identify Events/Goals

Tracking events/goals is how you record any actions your users perform. Every event call records a single user action and sends data to that specific event for engagement/conversion though postback URL. We recommend that you make your names human readable.  

Syntax

VaultSDK.trackGoal(GOAL_ID);

Note : GOAL_ID is unique goal id which you can find easily at Offer details section -> Settings tab.

Syntax Snippet

VaultSDK.trackGoal(105);

3. Identify Events / Goals with macros 

Syntax

var obj = {macro_name : value, macro_name : value, ..};

var objMap = new Map(Object.entries(obj));

VaultSDK.trackGoal(GOAL_ID, objMap);

Note:
– GOAL_ID is unique goal id which you can find easily at Offer details section -> Settings tab.
– Macro_name is a valid macro name that is listed while creating an offer in VaultPro system.
– Value is valid for respective macro as per rules in VaultPro system.

Syntax Snippet

var obj = {adv_sub : 123, adv_sub2 : 'xyz'};

var objMap = new Map(Object.entries(obj));

VaultSDK.trackGoal(105, objMap); 

CMS Integrations

WordPress

1) Install required component plugins in wp-admin

2) Follow the three integration steps which are listed above and add the VaultPro SDK script in HTML header.

3) No need to include JQuery externally, because it is already present in WP

4) If you want to track the events in your Word Press website, please put the following code with event id.

Syntax

<script>
    document.onreadystatechange = () => {
         if (document.readyState === 'complete') {
              jQuery('#component_id').click(function() {
                    VaultSDK.trackGoal(GOAL_ID);
              });
         }
    }
</script>

Note : Please refer the “#2 and #3 Identify Events” section above to know more about goal_id. And “component_id” will be the id of the javascript component.

Magento

For version 2.0.4

  1. Login as administrator
  2. Click on Store menu and configuration sub-menu.
  3. Inside General select Design option
  4. Follow the three integration steps which are listed above and add the VaultPro SDK script in HTML header, miscellaneous script field.
  5. If you want to track the events in your Word Press website, please put the following code with event id and along with component id.

Syntax

<script>
    document.onreadystatechange = () => {
         if (document.readyState === 'complete') {
              jQuery('#component_id').click(function() {
                   VaultSDK.trackGoal(GOAL_ID);
              });
         }
    }
</script>

Note: Please refer the “#2 and #3 Identify Events” section above to know more about goal_id. And “component_id” will be the id of the javascript component.   

For version 2.1  

  1. Login as administrator
  2. Click on Content menu and configuration sub-menu.
  3. In the list of themes, click on the edit button that lies on the right side of the list.
  4. Follow the three integration steps which are listed above and add the Unliche SDK script in HTML header, miscellaneous script field.
  5. If you want to track the events in your WordPress website, please put the following code with event id and along with component id.

Syntax

<script>
    document.onreadystatechange = () => {
         if (document.readyState === 'complete') {
              jQuery('#component_id').click(function() {
                    VaultSDK.trackGoal(GOAL_ID);
              });
         }
    }
</script>

Note : Please refer the “#2 and #3 Identify Events” section above to know more about GOAL_ID. And “component_id” will be the id of the javascript component.

Performance Impact

The SDK has been thoroughly tested and is known to cause no adverse performance impact to a website where it has been implemented. Further, the SDK is delivered via world-wide delivery points (edge locations via CDN) in order to maximize the speed of transmission of data between the websites and our servers.

Updated on April 8, 2019

Was this article helpful?

Related Articles

Leave a Comment