Advanced: Tracking Script & Data Collection

 Before you begin

As the title of this article suggests, this information is directed to advanced APSIS One users.

Make sure that you are familiar with the advanced aspects of Profile data, as well as Website tool activities before diving into this article.

 

About the Tracking Script

The APSIS One Tracking Script is a piece of code that allows your website to feed data into APSIS One. For us to gather data and give you fitting insights, you must install it. It will be used to gather web statistics for your websites, and it will also allow us to display the Cookie banners, Sign-up bars, etc. created with APSIS One.

trackingScript1.jpg

 


 

  Tracking Script Specifications


The Tracking Script loads asynchronously (operates independently, and does not depend on other applications) with an average of 50-60ms loading time, and it will not affect the performance of your website.


Please consider that if your domain is protected and can only be accessed with a specific link or by using a VPN, password or any other credentials, APSIS One will not be able to display your domain's status. What is more, the Tracking Script will not be able to collect data.

Jump to Tracking Script and Data Collection below for more details regarding data collection.


Make sure to install the Tracking Script in the head section of your website for optimal performance.


Is your website built as a Single Page Application? (SPA) If yes, make sure that the history.pushState() method is implemented, and is adding a state to the browser's session history stack. The URL change is optional. This method allows the Tracking Script to log Events like Page View into APSIS One Profiles when they browse your website. Read more in Mozilla Web Docs.


The Tracking Script is hosted on a CDN provided by Apsis, which means it's a third party script.


The requirements for the Tracking Script to properly perform are:

  • JavaScript.
  • LocalStorage.
  • Cookies.
  • Internet connection.

 


 

Tracking Script and Data Collection

By installing the Tracking Script in your website, you will be collecting visitor browsing data into APSIS One Profiles. Here's some valuable information regarding the actual script, details about data collection as well as the advanced Manual Data Tracking capabilities available today in the platform.

Click an item below to expand:

Tracking Script Sample

Here's a sample of a typical APSIS One Tracking Script:

<script type='text/javascript'>
(function (d) {
  var a1 = d.createElement('script'), fs;
  a1.type = 'text/javascript';
  a1.charset = 'UTF-8';
  a1.async = true;
  a1.src = 'https://static.ws.apsis.one/live/p/1297/29d2dec3.js';
  fs = d.getElementsByTagName('script')[0];  fs.parentNode.insertBefore(a1, fs);
})(document);
</script>
Tracked Data

The web data collected is stored in 2 places: in visitors’ browsers and in APSIS One’s cloud.

All data is stored as long as the APSIS One account admin has activated all options available in all Website tool activities in APSIS One, and that the visitor has given cookie consent. All Events are stored with a timestamp.

Here’s all data collected according to activity:

 

Sign-up bar

  • Sign-up bar is viewed/shown on website.
  • A value is submitted (email address, phone number).
  • Click on return offer (CTA that appears after visitor has already sent value).

All above Events include:

  • A unique activity ID for the Sign-up bar. A website may have more than one active Sign-up bar.
  • The web domain the Sign-up bar is active on.
  • The URL where the Sign-up bar is displayed on.
  • Referrer page: the webpage the visitor came from, before arriving to the page where the Sign-up bar is displayed.

 

Cookie banner

  • The cookie banner is viewed/shown on website.
  • Cookie consent is submitted. 

All above Events include:

  • A unique activity ID for the cookie banner. A website may have more than one active cookie banners, by using the advanced Match cookie/Language option.
  • The web domain the cookie banner is active on.
  • The URL where the cookie banner is displayed on.
  • Referrer page: the webpage the visitor came from, before arriving to the page where the cookie banner is displayed.

 

Auto collect

Page views

Site searches

  • The search term used by the visitor.
  • URL of page viewed/shown.

Google Analytics

  • UTM parameters present in URL of the page viewed/shown. 

Google SEO/SEM

  • Whether the visitor’s page view originated from an organic or paid source.

Facebook Ads Referral

  • The domain associated with the ad.
  • URL of page viewed/shown.
  • Type of data source, in this case it will show as "ads".

File Downloads

  • The domain where the file is hosted.
  • URL of page where the file was downloaded.
  • Link to the file and its link title.

  

Product Views

  • Name of the product viewed/shown.
  • Name of the product category that the product viewed/shown belongs to.
  • Price of the product viewed/shown.
  • Image of the product viewed/shown.
  • Any other data that corresponds with elements mapped with the Product views activity.
Advanced: Manual Data Tracking

About Manual Data Tracking

For our more advanced APSIS One users, we've created 5 additional, generic Events that can be used to collect Profile data. We aim to release Website tool activities that will simplify the collection of these Events for all kinds of APSIS One users. However, here you can find what is possible already today in terms of additional data collection. Learn more about Profile Events...

As an advanced user, with development skills or access to development resources, you'll need to add these small JavaScript tags to your website and trigger them independently.

Note that all data Attributes in these Events are fixed, as well as mandatory. We suggest that you use 0 as an empty string or integer.

Sample Snippet

Here's a sample for a conversion Event for Profiles that added an item to their wish list:

var ely = ely || [];
ely.push(['Trigger.ConversionBasic', {
eventCategory: "Add to Wishlist" ,
eventAction: "Click",
eventLabel: "<insert product name and/or ID>",
eventValue: <insert product value>
}]);

 

  About Tag Management Systems

Implementing the snippets in your website can be done quickly by using a Tag Management System (TMS).

These JavaScript tags are fully compatible with Google Tag Manager, and any other TMS that support JavaScript snippets.

trackingScript6.jpg 

 

Need a hand?

Since this is a feature that is not yet available in our standard Website tool activities, we have limited Support and troubleshooting for all of our APSIS One users. Feel free to reach out to us via email if you have any questions or require assistance.

Click an item below to learn how to implement manual data tracking.

Conversion Event

Conversion - Basic

This Event reflects that a Profile has converted from a regular visitor to a prospect or lead. For instance, you may log this Event into a Profile when a visitor has chosen to add an item to their wish list or signed up for a free trial.

Here's the snippet:

var ely = ely || [];
ely.push(['Trigger.ConversionBasic', {
eventCategory: <string> ,
eventAction: <string>,
eventLabel: <string>,
eventValue: <integer>
}]);

 

Order Created Event

Order - Created

This Event reflects that a Profile has placed an order on your website's online store.

Here's the snippet:

var ely = ely || [];
ely.push(['Trigger.OrderCreated', {
orderId: <integer> ,
customerId: <integer>,
isGuest: <boolean>,
createdAt: <string>,
websiteName: <string>,
storeName: <string>,
grandTotalAmount: <number>,
shippingAmount: <number>,
discountAmount: <number>,
shippingMethodName: <string>,
paymentMethodName: <string>,
itemsCount: <integer>,
currencyCode: <string>
}]);

 

Product Order Event

Order - Product

This Event reflects that a Profile has ordered one product in your online store. Make sure to log this Event into the Profile once per each product ordered.

Here's the snippet:

var ely = ely || [];
ely.push(['Trigger.OrderProduct', {
orderId: <integer> ,
productId: <integer>,
sku: <string>,
name: <string>,
productUrl: <string>,
productImageUrl: <string>,
qtyOrdered: <number>,
priceAmount: <number>,
rowTotalAmount: <number>}]);

 

Cart Created Event

Cart - Created

This Event reflects that a Profile has created a cart in your online store, by adding one or more items. Note that this Event is logged when the visitor adds their first item(s) to their cart. If they add more items, the Product Carted Event will be logged for each additional item(s).

Here's the snippet:

var ely = ely || [];
ely.push(['Trigger.CartCreated', {
cartId: <integer> ,
createdAt: <string>,
storeName: <string>,
websiteName: <string>
}]);

 

Product Carted Event

Cart - Product

This Event reflects that a Profile has added one or more items to their cart on your online store. Make sure to log this Event for each individual product that has been carted.

Here's the snippet:

var ely = ely || [];
ely.push(['Trigger.CartProduct', {
cartId: <integer> ,
productId: <integer>,
sku: <string>,
name: <string>,
productUrl: <string>,
productImageUrl: <string>,
qtyOrdered: <number>,
priceAmount: <number>,
rowTotalAmount: <number>
}]);

 

Cookies

All cookies are set by the JavaScript code on your domain, which means all cookies tracked with APSIS One are first-party cookies.

Here's the cookies APSIS One collects according to storage:

Cloud storage

  • Ely_vID: Profile ID.
  • Ely_cc_answ: Cookie consent.
  • Elytil: Whether the visitor is a first time visitor or not. Appears only once per Profile.
  • Elytis: Whether it's a new browser session. Appears once per browser session.
  • Cookie-banner-session, capture-bar-session-<hash>: Cookies that help monitor the status of Sign-up bar and Cookie banner activities.

Local storage

  • Ely.deferred_Events: Events that took place up to an hour before visitor provided cookie consent. If consent is not provided within an hour, Events are deleted.
  • Ely.Profile: A visitor's local Profile.
  • Innometrics-cookie-banner-variable: Shows the correct status of the Cookie banner.
  • pcdc:  The service structure for the Events being sent to Audience.

 


 

Intelligent Tracking Prevention

Intelligent Tracking Prevention (ITP) is a browser feature that aims to safeguard online privacy by changing the way first-party cookies are handled by browsers. ITP uses machine-learning to keep track of which domains have the ability to track visitor behaviour across different websites. How's your cookie knowledge?

APSIS is closely monitoring current developments on Intelligent Tracking Prevention (ITP), and looking at all major vendors. We evaluate all privacy measures, as well as the vendor's privacy policies, to ensure that we enable our customers' to make the most of APSIS One while still following the spirit of ITP.

These new measures are primarily aimed at more invasive, third party, cross-site tracking and are not intended to disrupt the legitimate, first party, consent-based tracking that APSIS One performs on behalf of its customers. So, we're working on product enhancements to ensure that we are not inadvertently disrupted by any new measures implemented. Read more in Apple's website...

Since we're working in a first-party context, with first-party cookies, upcoming SameSite restrictions will not affect your experience using APSIS One to collect visitor data.

Expand an item below to learn more about how Intelligent Tracking Prevention works with different browsers and versions.

Safari

As to ITP 2.1, cookies set with JavaScript will last only for seven (7) days. On a visitor's first visit, an Unknown Profile is created upon cookie consent. If the visitor returns to the website within the seven (7) days, a new cookie is created with the same Cookie ID and Website Interaction Events are kept within the same Unknown Profile. If the visitor does not return within that time period, a new cookie is created as well as a new Unknown Profile with a new Cookie ID.

When it comes to ITP 2.2, when the domain is classified as having cross-site tracking capabilities by ITP 2.2), cookies set after a URL parameter last for only one day (24 hours). A cookie is created when the visitor arrives to the website, and so an Unknown Profile is created with the Cookie ID, but when the cookie expires the Unknown Profile stops collecting Website Interaction Events from their visit. A new Unknown Profile, with a new Cookie ID, is created upon the next visit.

Finally, ITP 2.3 prevents domains with cross-site tracking capabilities from collecting browsing data past the 24 hours, altogether. The local storage of the site will be deleted in seven (7) days, providing that the visitor uses Safari exclusively, and does not return to the website during this time. However, this is not applicable to APSIS One's Tracking Script.

When it comes to APSIS One's Tracking Script, the most relevant scenario is related to ITP 2.1. This version of ITP restricts behavioural data from being collected past the seven (7) day time period, yet still allowing for the visitor to come back during within the week and prolong their cookie lifetime.

Chrome

There is no automatic restrictions in Chrome, but there are settings available to allow websites to save cookies (enabled by default) and also block third-party cookies (disabled by default). Read more... 

Firefox

Firefox will block all scripts considered as third-party cookie trackers in the future. Read more...

For now, we can't say this solution has been implemented yet. Default settings in Firefox currently match Chrome's settings, allowing individuals to disable third party cookies themselves. 

 


 

 

Was this article helpful?