Intellectual Property

Copyright 2024 Celebrus Technologies plc
https://www.celebrus.com

Protected by patents in the U.S. and Europe:

US10430037, EP2684143, US8365188, EP1997041, US8880710, EP1979840, US8898309, EP1979839

A hands on guide to using the Celebrus data collection for HTML5.

1. Installing the Celebrus data collection for HTML5

Celebrus collects data from HTML web pages using a JavaScript Client Side Adapter (CSA). This is a data collection agent tuned for running in an HTML5 environment, transmitting collected data to the Celebrus Collection Server.

The CSA supports HTML5 and its predecessors.

1.1. Before you begin

Throughout this document the term csaName is used to reference the designated prefix applied to all top-level scoped variables and functions within the CSA. This prefix is configurable and prevents collisions with existing variable or scripts used on the website. As such example JavaScript may include the csaName prefix where appropriate. This must be replaced with the CSA name configured for your Collection Server. In such cases the prefix appears as shown below:

var [csaName]WindowLevelScopedVar = "example";

1.2. Downloading the insert

The CSA can be downloaded from the Celebrus Collection Server. Ask your administrator for the Celebrus data collection URL and browse to it. The CSA is a single JavaScript file, CelebrusInsert.js which should be downloaded and hosted by the website or Content Delivery Network (CDN).

All scripts have already been minified to reduce bandwidth. Do not attempt to minify further or to edit the scripts unless directed to do so, as in doing so could corrupt them. Some methods and variables require window level scope and as such minifying these names would result in a non-working CSA.

The CelebrusInsert.js has several options you can configure using the Configuration Manager. Once configured a new CelebrusInsert.js can be downloaded from the server.

1.2.1. Hosting the insert

The CelebrusInsert.js is typically sourced from your web server so that its availability mirrors the availability of your own website. Because the reference to the CelebrusInsert.js file appears on each monitored page of the website, care should be taken with the caching and compression options available to limit network bandwidth. There are various options available, the most common are listed here.

1.2.2. Last-Modified response header

If enabled within the web server, indicates when a file was last modified and is returned in the response for a file from the web server when first requested. When the browser subsequently requests the file it automatically includes this header which the web server can use to determine whether the resource has been modified since it last served the content. If no change has occurred a 304 Not Modified response is returned by the web server without delivering the file again. In such cases the browser re-uses its cached copy.

1.2.3. Cache-Control header

A Cache-Control header max-age value can be returned by the web server which indicates the number of seconds a cached copy should live for before requesting the file from the web server again. The s-maxage value performs a similar role but applies to shared (public) caches.

The advantage of using these headers is that the browser does not even attempt to request the resource from the web server if the max-age value has not been exceeded, making a considerable saving on communication between the browser and the web server. The drawback is when the file on the web server is changed there is a lag period until the browser’s copy of the file exceeds its max age value before it requests and receives the updated file. A good compromise is a setting of 900 seconds, 15 minutes.

The use of Cache-Control header with Last-Modified result in a request for the file once every 15 minutes at most, and even then a 304 Not Modified response is returned with no file returned.

1.3. Loading and execution considerations

Several approaches to instrumenting the website exist, each providing their own benefits. Whichever approach is taken however the website needs to include the changes.

1.3.1. Executing inline before the </head>

This is the generally preferred approach, loading the CelebrusInsert.js in the <head> giving this approach the advantage that the CSA is ready to execute as soon as possible.

To use this approach simply include the JavaScript as below, before the </head> tag:

<script type="text/javascript" src="/`CelebrusInsert.js`"></script>

Can be advantageous if the web page in question is heavy content wise. In such cases if the insert was loaded immediately before the </body> tag, loading may be delayed whilst other website resources are downloaded.

All scripts defined in the <head> section are downloaded before the browser starts to parse the <body> section so the CelebrusInsert.js file is guaranteed to be downloaded before the browser starts to render.

1.3.2. Executing inline before the </body>

This approach may delay the onLoad event firing in the page, but strikes a balance between data collection priority and web page. To use this approach simply include the JavaScript as below, before the </body> tag:

<script type="text/javascript" src="/`CelebrusInsert.js`"></script>

1.3.3. Executing when the onLoad fires

For ultimate peace of mind the insert can be sourced when the onLoad fires, guaranteeing not to place load on the web browser until that point. The downside is that this approach can delay data collection and if enabled Celebrus personalisation. To use this approach simply include the Javascript as below, before the </body> tag:

<script type='text/javascript'>

 window.addEventListener('load', function() {
   var scriptElement = document.createElement('SCRIPT');
   var serverLocation = SERVER_LOCATION;
   var protocol = document.location.protocol;
   scriptElement.src = protocol + "//" + serverLocation + "/CelebrusInsert.js";

   if (document.body) {
     document.body.appendChild(scriptElement);
   }

 }, false);
</script>

1.4. Including the script

The script can be included within the website in one of a variety of ways depending upon how the website and its underpinning content management system is deployed. It is however crucial that the insert is included in each and every and frame of the website. Failure to do this reduces the accuracy of the data collected.

1.4.1. Page template

Adjusting the page template for the website to include the Celebrus script is typically the easiest approach, achieved within the website’s common header or footer.

1.4.2. Network infrastructure

Using network infrastructure such as proxies to dynamically insert the Celebrus script. This approach is beneficial if access to the page template is not possible. However for SSL traffic this can be problematic unless the SSL is being terminated at the load balancer and not by the Celebrus Collection Server.

1.4.3. Manual modification

Given the complexity of websites today this approach is rarely used, being simply just too time consuming and error prone.

1.4.4. Tag management systems

Instrumentation using a tag management system (TMS) is very straightforward since there is only a single tag to include. As described above this can be configured to be Executing inline before the </head> to ensure the CSA is ready to execute as soon as possible or Executing inline before the </body> to strike a balance between data collection priority and web page.

Celebrus can advise on placement of the tag in an organization’s website pages but it is the responsibility of the TMS specialist at the organization to actually configure the TMS appropriately.

1.5. Initialise the CSA

The CSA initialises automatically when the page loads, hence nothing to do.

1.6. Logging

The CSA has built in logging which can be activated at any time, by setting the appropriate logging level:

[csaname]Logger.setDebugLogLevel();
[csaname]Logger.setInfoLogLevel();
[csaname]Logger.setWarnLogLevel();
[csaname]Logger.setErrorLogLevel();
[csaname]Logger.setFatalLogLevel();
[csaname]Logger.setAllLogLevel();
[csaName]Logger.setLogLevelOff();

This command can be entered directly within a browser’s debug console, typically accessible by pressing the F12 key. The full range of LogLevel’s available, in order of increasing detail, are: `OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL. Setting a log level will enable all logs of that and lower levels of detail. For example a LogLevel of WARN enables WARN, ERROR and FATAL messages to be displayed.

Setting a LogLevel of DEBUG results in an additional script CelebrusLoggingUtils.js being sourced from the Celebrus Collection Server. This script provides detailed logging of event contents.

When set a LogLevel is persisted within the web browser session storage (if supported). This means that the LogLevel set is persisted through page navigations if the origin of the web page remains the same. For example books.mysite.com and music.mysite.com would have different session storage objects even though they share the same domain.

To disable logging, call:

[csaname]Logger.setLogLevelOff();

Session storage does not survive the browser being closed so simply restarting the browser also clears any LogLevel set.

1.7. Testing locally with a dry run

The dry run mode of operation for the CSA allows the developer to run Celebrus code in a web page without having any communication between the page and a Collection Server. With this mode of operation It is not necessary for there to be a live Collection Server running although it is necessary to make Celebrus files downloaded from a Collection Server available from a web server.

The files necessary to carry out a dry run are:

CelebrusLoggingUtils.js
CelebrusInsert.js

A page can be marked as being in dry run mode by including a window-level JavaScript variable set to true, like this:

window.[csaName]isDryRun=true;

where [csaName] indicates the CSA name for the Collection Server which ultimately carries out the event collection. Although it is not necessary for the Collection Server to be available during a dry run, it is necessary to download the above two JavaScript files from a Collection Server and make them available to the page from an accessible location. When CelebrusInsert.js executes and detects it is in a dry run environment it simply picks up a default set of configuration details from CelebrusLoggingUtils and carries out its normal logging output.

Again the most effective way of using dry run mode is to add the three necessary files to each test page using a tool like Greasemonkey. In this case the full script that should be included in each page looks like:

window.addEventListener('load', function()
{
   window.[csaName]isDryRun = true;
   var scriptElement = document.createElement('SCRIPT');
   var serverLocation = 'DATA COLLECTION SERVER';
   var protocol = document.location.protocol;
   scriptElement.src= protocol + "//" + serverLocation + "/CelebrusLoggingUtils.js";

   if(document.body) {
     document.body.appendChild(scriptElement);
   }

   var scriptElement2 = document.createElement('SCRIPT');
   scriptElement2.src= protocol + "//" + serverLocation + "/`CelebrusInsert.js`";
   if(document.body) {
     document.body.appendChild(scriptElement2);
   }

}, false);

1.8. Celebrus API

The CSA provides various API functions to allow some manual operations to be invoked by the website if that is required. A window-level Celebrus API object is defined for the page and is prefixed using the CSA Name assigned for the installation. So for instance if the CSA Name being used is "devtest" then the Celebrus API object will be

devtestCelebrusApi

Note that in previous releases Celebrus made API functions and properties available as a series of distinct window-level references. Refer to the Celebrus API functions table to see a list of API functions and their corresponding window-level equivalents as described in previous releases.

1.8.1. Stop the CSA (Page)

The CSA can be explicitly stopped at page level using:

[csaName]CelebrusApi.stop();

1.8.2. Start the CSA

Once a CSA is stopped there will be no further event collection on the page until the CSA’s start function is called.

[csaName]CelebrusApi.start();

1.8.3. Stop the CSA (Session)

Collection can be stopped at session level by calling the same stop function but including a 'true' parameter to indicate the session should be shut down.

[csaName]CelebrusApi.stop(true);

When event collection is stopped at session level the CSA in the current page stops sending events and a cookie value is set which prevents any CSAs in further pages from starting up.

1.8.4. Clearing stopped state

The stopped state can cleared using the following call:

[csaName]CelebrusApi.clearStoppedState()

This removes the cookie indicating that the session has been shutdown and a new session is created by the next CSA which initialises, for instance as a result of a call to the 'start' API function or a new instrumented page loading.

See the Celebrus API functions table for more details.

1.9. Exception handling policy

The CSA captures any exceptions which are generated whilst it is running. If an unexpected exception occurs the CSA automatically transmits this information back as part of the data collection.

1.10. Monitoring brands across multiple domains

As visitors browse multiple brands of the same organisation each new domain encountered would normally result in a unique session being allocated for each. It is, however, possible to extend a session across multiple domains by using cross-domain functionality.

A domain name is a human readable identifier ultimately representing an IP address. Domains are represented using a hierarchical dot notation. dvd.myshop.com is a sub-domain of myshop.com. Data collection operates across subdomains automatically without the need for cross-domain. However myshop.co.uk is not a sub-domain of myshop.com or myshop.fr. As a result three sessions would normally be collected for a visitor who navigated all three websites one after the other.

Enabling cross-domain functionality allows Celebrus to use its first party cookies in conjunction with third party cookies the Celebrus Collection Server sets on the collection host.

Cross-domain reduces the number of web sessions created during data collection, but it does not alter the licensed web session count. The system counts a cross-domain hop within its licensing irrespective of whether events are being collected under the same session number or not.

1.11. Default browser settings for third party cookies

Historically default browser settings have allowed websites to set third party cookies if an appropriate P3P header has been set for the request. However the default cookie settings for Safari and Firefox currently have a more conservative approach. From a data collection point of view this change lessens the effectiveness of cross-domain. See Intelligent tracking prevention (ITP).

1.12. Google’s Privacy Sandbox and SameParty cookies

Google’s Privacy Sandbox is a work in progress and as such the information contained herein could become obsolete as Google develops and changes its implementation. The information detailed here should only be used for non-production testing at this time.

Google has stated as part of its Privacy Sandbox initiative, it is to drop support for 3rd party cookies within Chrome sometime in 2022. This change will prevent cross-domain functioning in its current form on Chrome (and likely Edge), meaning that events are collected within separate session contexts, one per domain a visitor traverses. Collection within multiple sub-domains of a common domain would not be impacted.

As part of this initiative Google is introducing the concept of First Party Sets, providing a mechanism for an organisation to declare the website domains it owns as belonging to the same party. Cookies marked with a new SameParty attribute are then visible between domains within the same First Party Set. As Celebrus is a first party solution, cross-domain functionality can be maintained if Celebrus is deployed as part of a First Party Set.

Support for this experimental feature can now be enabled directly within the Configuration Manager’s Deployment app.

The task of declaring the First Party Set is your responsibility. Only your organisation can determine the appropriate domains which should be included in such a set.

Further details regarding First Party Sets can be found here.

1.13. Data collection DNS name considerations

It is recommended that the Collection Server is in the same domain as the principle brand or website being monitored. For example, if you deploy a system to acme.com then collection.acme.com would be a good name for the Collection Server.

The benefits of this approach are:

  1. Minimising the threat of DNS server poisoning
    Websites already have procedures and configurations to ensure the integrity of their DNS name servers, so utilising these to serve the name of the Collection Server makes good sense.

  2. User confidence
    Some technically aware users research the sites associated with website being monitored using a variety of mechanisms, hence a Collection Server in the website domain makes more sense to them.

  3. DNS black-holing
    Some ISP’s have been known to set DNS null entries for known monitoring sites to minimise traffic over their network.

  4. Intelligent tracking prevention (ITP)
    Domain alignment ensures Collection Servers can set first party cookies and furthermore that the cookies can be set in HTTP responses sent by the Collection Servers rather than in JavaScript. See Intelligent tracking prevention (ITP).

1.14. Use of SSL for transmission

All data is collected using HTTPS. Earlier versions of Celebrus allowed data collection using HTTP but this is no longer supported.

2. Sessions

All activity tracked is assigned to a session. A session is a period of continuous use of the web application, and can be viewed in a similar way as a web browser session.

2.1. Session lifecycle

The diagram below shows a typical session. The session starts when a new browser instance requests the first page on an instrumented web page. In this example, the user may choose to navigate to other pages, as represented by the second page starting to load in the diagram. After some activity by the user there follows a period of 30 minutes of inactivity. At this point, the session expires in the Celebrus system, which causes the last page to unload and a session end is generated.

session lifecycle

2.2. Maximum session duration expiry

The next scenario to address is what happens after three hours of collection (the maximum session duration). In this case, the user does not navigate off page until some time later and it is only then that a new session is allocated.

Therefore the session is not ended and continues to collect events as normal. When the user next navigates to another page, the Celebrus system starts a new session. The first session ends and is summarised as normal.

maximum session duration

3. Collection Rules

In order to test collection you will first need to configure the collection rules. Collection Rules let you control the level of data collection from the HTML5 JavaScript and Mobile data collectors (CSAs).

3.1. JavaScript Insert

These options change which attributes are present in the Web/PageLoading event (the first event from any web page). If you change any of these settings, then you must download the CelebrusInsert.js from the Collection Server and re-deploy on your website.

3.2. Headers

Use these options to capture HTTP headers seen by the Collection Servers. You can also configure the use of aggressive data collection techniques.

3.3. Variable and Content

Variable and content rules allow specific elements of a web page to be collected. This is useful for collecting data which isn’t captured as part of a visitor’s interaction with the website (for example, data layers).

These rules can capture script variables at the window[variable name] level of a web page, and also properties of items embedded within a page. Content to be collected is identified by specifying match details for any combination of the name, id, class, tagName, href or src attributes. All matches are case sensitive. All, with the exception of tagName, support wildcards at their start and end. Alternatively, for the JS10 CSA, content to be collected can be specified using a CSS Selector, which Celebrus will use in conjunction with the standard JavaScript document.querySelectorAll(selector) function to identify which elements match.

You can configure whether variables and content are collected when first encountered, upon change, or when the visibility of content changes. Alternatively a second variable can be monitored to act as the decision point to determine when capture is to occur. Further options specify how the value is captured, using toString or JSON.stringify.

When capturing a JSON representation of a JavaScript object care should be taken to avoid reference cycles and to consider data volumes.

3.4. Meta Tag

Meta tag attributes can be collected using the meta tag rules. You can capture the content attribute of a named meta tag, or choose to capture a specific named attribute.

3.5. Page

Page rules are the primary mechanism for determining what data is collected from a given page within a website or mobile app. Rules are evaluated in ascending priority order. The first rule which matches determines what data is collected from that page. If no rule matches, nothing is collected.

The types of events which can be configured depend on whether the rule is targeting websites or mobile pages. A rule can have a set of exceptions associated with it. These exceptions change the configuration for specific elements on the page. For example, a rule can be configured which excludes credit card fields from collection.

3.6. Mobile

For mobile apps some collection options make more sense when configured at app level rather than on a page by page basis. The options enabled on this tab are applied when the CSA starts and are maintained for the duration of the session.

4. Testing

4.1. Simulating different geolocations with Modify Headers

Browsers provide plugins to modify or tamper with the HTTP headers as they are sent from the browser. This therefore provides the ability to simulate a visitor from another geographic location. In tandem with other techniques listed here to collect data from any website before it is instrumented, this represents a powerful approach to testing before any live changes are made to the website.

  1. Install Modify Headers for Firefox
    https://addons.mozilla.org/en-US/firefox/addon/modify-headers/

  2. Add new action Click on the modify headers button button and select the Open Modify Headers option:

    modify headers

    Select Add and enter the appropriate X-Forwarded-For IP address similar to the example shown next:

    modify forwarded for

    Press the Add button and the entry is added:

    modify action added

    Press OK.

  3. Start and test Right-mouse click on the button and select Start.

    The icon turns red indicating that Modify Headers is running.

    Browse the website and the X-Forwarded-For header indicates that the browser is located at IP address 173.194.67.139.

4.2. Checking geolocation for a given IP address

Celebrus makes use of the MaxMind geolocation databases which are embedded within the Celebrus system. Maxmind does however provide a lookup web service which can be used to determine the basic information which this database contains for a given IP address. Browse to https://www.maxmind.com/en/home.

maxmind

4.3. Creating test cases for any website

This approach can be used to obtain data from any website which can be used as a test case. This data can be repeatedly run through the Celebrus configuration. The test case recorder within the Semantic App can be used to collect data conforming to the license of the installed Collection Server. However it also provides the capability to record from any website. The test case recorder dynamically instruments the website when it loads.

  1. Log in to the Configuration Manager Using the URL of the Configuration Manager provided by your system administrator or vendor, login.

  2. Select the Test and Samples app within the DATA PROCESSING sidebar menu.

  3. Select Create Test Case.

  4. Enter an appropriate test case name and select all websites and collect from any website options.

  5. Enter the URL of the website you wish to record from, then press the record button. Interacting with the website produces events within the pane below the web-browser.

  6. The lower pane shows the collected events. This includes the processing of the collected data applying any semantic configuration. The test case can be re-run at any time, pushing the raw collected events through the semantic configuration to see if there are any changes.

4.4. Collecting data from any website with Greasemonkey

This approach can be used to test a data collection installation before the website has actually been instrumented. Browser plugins can be used to instrument a website dynamically, for any website. This only impacts the browser on which the plugin is installed and configured, requires no involvement of the website in question and is a super quick way to get some real data. This approach does need a Collection Server to be installed. Speak to your support representative if you require further assistance.

Greasemonkey is one such plugin for Mozilla Firefox which allows a web page to be modified by using small bits of JavaScript. In this specific example we’ll set-up Greasemonkey to inject the Celebrus insert into the web page when the onLoad event fires.

4.4.1. Install Firefox and Greasemonkey

4.4.2. Create a new script

The Greasemonkey icon should be available within the Firefox toolbar:

monkey button

Click the arrow and select the New User Script from the resulting menu.

new user script

4.4.3. Edit the script

Select all of the existing text and replace with the script below:

// ==UserScript==
// @name Celebrus
// @namespace Celebrus
// @description Celebrus
// @version 1
// @grant none
// ==/UserScript==
window.addEventListener('load', function()
{
 var scriptElement = document.createElement('SCRIPT');
 var serverLocation = '<Collection Server>';
 var protocol = document.location.protocol;
 scriptElement.src= protocol + "//" + serverLocation + "/CelebrusInsert.js";

 if(document.body) {
   document.body.appendChild(scriptElement);
 }
}, false);

Replace the <Collection Server> with your Celebrus Collection Server. This must be specified in quotes and with the protocol or any trailing forward slashes. For example, if your Collection Server is located at http://datacollection.celebrus.com/ the string should be set to datacollection.celebrus.com.

Press the Save button. Make sure you enable Greasemonkey.

5. Integrating data with other systems

Integrating data from other systems already present on the website can appear potentially challenging at first, but it is in fact quite simple to achieve. The key to such integrations is to bridge the identifier used by the Celebrus and other system. Once bridged, the data from either system can be joined.

The Celebrus session identity should be handled with care. Access to it permits a malicious entity to push data into the system pretending to be from the session.

5.1. First party presence

If the other system has a first party presence on the website, then the Celebrus session key can be readily shared. The identities of both systems are in the same scope and have visibility to one another.

5.2. Third party presence

If the other system has a third party to the website such as an iFrame in another domain, then this presents another hurdle, but one which is readily negotiated.

The JavaScript example below demonstrates the mechanism by creating an iFrame in the domain of the other system, placing the Celebrus session identification on the src attribute.

Because the script is created in the first domain, that of the website, access to the Celebrus session identification is available. When the iFrame executes, the browser places the cookies associated with the other system within the HTTP headers of the request. The other system’s web server then gets to see both the Celebrus identify and its own. A bridge has been built.

var iframe = document.createElement("IFRAME");
iframe.id = "iframeId";
iframe.style.height = 0;
iframe.style.width = 0;
iframe.style.frameborder = 0;
iframe.style.border = 0;
iframe.src = "http://[other system]/Celebrus/bridge.aspx?session="
 encodeURIComponent(CelebrusIdentifier);
document.body.appendChild(iframe);

6. Website performance and data collection

Website performance is key, but exactly what does this performance mean in this context? It is the time before the document.onLoad event by the browser? What is the document.onLoad event? Is this what makes the user experience exceptional?

Two O’Reilly resources discussing these topics are highly recommended:

6.1. What does Celebrus measure?

Celebrus measures the time taken from user navigation (click) to DOMContentLoaded if the Celebrus insert is invoked at the end of the </body> tag. If the Celebrus insert is dynamically injected when the document.onLoad event fires it measures the time taken from user navigation (click) to document.onLoad. As the previous section discusses, this is not necessarily the user experience. However trends of these measurements are extremely useful to detect unexpected changes in performance, along with relative comparisons between ISPs, geographics, browsers etc.

6.2. Adding Celebrus to the web page and its impact

The Celebrus script loads and executes asynchronously to other resources so its impact is minimal, but like all web page resources, it can hold up other resources or firing of certain browser events. There is no silver bullet, it is a call on the priorities and objectives of the business.

It is possible that the inclusion of the script means that the document.onLoad doesn’t fire within the browser until Celebrus has loaded.

If the website is depending upon this event to fire before the page is made accessible to the user then consider injecting the Celebrus insert dynamically as a result of the document.onLoad event firing. By delaying the loading of the Celebrus insert, the website loading is not impacted but there is a possibility that the user interacts with the web page before the Celebrus insert is running. If Celebrus is executing personalisation then this is delayed as a consequence.

If the website document.onload event fires quickly, any delay in starting the Celebrus insert is minimal. In such cases user interactions occurring before Celebrus is able to capture them could be reasonably expected to be very low. The Celebrus script is a single file which when compressed is around 42KB. The file is static hence can be cached by the browser.

Check with your performance tool vendor to determine whether it can perform tests with and without cached resources, so as to get an accurate picture of the user experience.

6.3. Website performance test tool

Depending on how your tool works, data collection license usage occurs when the tool executes. This is not normally an issue because the volume of test traffic compared to real traffic is small. Should this be a concern, the Celebrus system can be configured to selectively exclude this traffic from instrumentation using user agent or IP address. If such filtering is implemented, it should be noted that you are tailoring for your test tool, hence testing web page versions which are not seen by real visitors, perhaps reducing the validity of the test tool results.

6.4. Limiting impact

From the outset Celebrus customers have always required near zero impact. To achieve this data collection agents are intelligent:

  • Self-diagnostics with any errors sent back to the Collection Server, and not surfaced to the end user

  • Data collection back-off in case of failure, such as communications outage

  • Dynamic tailoring of data collection based upon browser capabilities

  • The script used by the Celebrus technology is static, hence can be aggressively cached by web browsers.

6.5. Performance test considerations

  • Focusing on one particular browser event firing such as document.onLoad can be misleading because this doesn’t necessarily reflect the user experience.

  • Celebrus performance measurements won’t necessarily reflect user experience. Trending changes in measured performance, or relative comparisons are perhaps more useful at times.

  • Script deployment can be flexible to meet organisations priorities. Script is browser cacheable to further reduce impact.

  • Deployments can prevent execution for website performance testing tool visits, but this should be used with caution as it is changing the nature of the performance test.

7. Data collection under the hood

7.1. Communication with Collection Server

Below are two sequence diagrams describing the communication between the web server, client browser and Collection Server.

7.1.1. Initial page in visit

initial page

7.1.2. Subsequent page in visit

The CSA attempts to transmit all data for a page before the page unloads. Some browsers abruptly stop communications, in which case Celebrus transmits events which weren’t sent at the start of the next page.

subsequent page

7.2. Resiliency features

As with any browser app communicating with two or more hosts, care must be taken to ensure that failure of one of the systems does not delay page rendering. This is true for any content included in web pages, and similarly applies to Celebrus. The system includes mechanisms designed to avoid failures in the server or associated network infrastructure from impacting the performance of instrumented websites.

7.2.1. Decoupling

The CSA is intelligent and has been designed to have minimal impact on a website, both in terms of normal operation and during various failure scenarios.

Multiple strategies are employed both within the client JavaScript and the Collection Server to address potential failure scenarios.

Server-side the following strategies are employed:

  1. Decoupling of data collection network processing from data processing.

  2. Automated congestion and overload management.

  3. Integrated back-off strategies to ensure graceful degradation.

    1. HTTP 1.1 persistence back-off.

    2. Thread exhaustion management.

Client-side within the JavaScript the following strategies are employed:

  • Internal monitoring in the CSA with automated shutdown in the event of errors or apparent network congestion.

  • Initial script CelebrusInsert.js is sourced from website being monitored to avoid dependence on remote systems.

  • Collection shutdown on receipt of HTTP 400 and above errors allowing the site owner to instantly disable collection in the event of unforeseen problems.

  • The single-insert allows rapid de-instrumentation if ever required.

In the event of failure in communications between the browser and the Collection Server, no impact to the user experience occurs in most cases.

  • Versions of Microsoft Internet Explorer prior to 5.5 cannot be decoupled. This however is an extremely out of date browser.

  • Some browsers may show a progress bar, however the web page operates normally.

  • Web pages designed with a reliance on the onLoad event firing may be impacted in the scenario where a data collection request is not terminated. In such cases the request times out typically after 30 seconds, hence delaying the onLoad firing by this amount. In cases where the data collection request fails but receives a response such as HTTP 503 for example, no delay is incurred.

  • Browsers behind proxies may be coupled with the data collection communications as the browser multiplexes communications to all hosts over the same connections. With modern browsers which open more connections this is not a problem.

7.2.2. Client-side back off strategy

When the CSA executes, an initial handshake request is sent for each web page to Collection Server, recording the page loading event. If a valid response to this request is not received within a given time window, the CSA enters a shutdown state signified with the setting of a [csaName]SF cookie. The shutdown state prevents the CSA from attempting to communicate with the Celebrus Collection Server again until either a new session occurs, or the maximum session duration has elapsed. Invalid responses which can occur resulting in a shutdown state include a request timeout, or HTTP response with a value such as 503 service unavailable.

Any communication errors that occur after the initial handshake request are tolerated within a page as long as no more than five occur consecutively, after which the CSA stops executing for that page.

7.2.3. Sizing infrastructure

Tools available from your vendor are available to help model traffic levels and probable peak loadings. Upon initial deployment some care should be taken to ensure that estimates of traffic levels are correct, typically by initial deployment on a limited page set or collection from a limited sample of sessions.

7.2.4. Fail safe

Should a problem occur various mitigating options are available:

  • Replacing the contents of the CelebrusInsert.js hosted by the website with a blank file. This disables data collection at source though the immediacy can be undermined by browser caches.

  • Stopping the Collection Server itself, so no process is running. This can be done using the OS service management facilities. It is imperative if this approach is taken that any front-facing load balancers terminate inbound data collection requests, rather than dropping the request. Failure to terminate the request with a response results in a timeout for the request when made by the web browser.

7.2.5. Client-side errors

The CSA captures and reports on any script errors occurring on the page, this includes both errors generated by your page and the scripts within it, and also on any internal errors in the CSA. The CSA prevents internal errors being presented to the user, thus ensuring they have a clean browsing experience. The level of detail available in captured error reports may be limited depending upon what is surfaced by the browser in question.

7.3. Cookies

A cookie is a small piece of data:

  • Web apps can use to remember state.

  • Associated with a domain, for example: celebrus.com.

  • Can be set as secure, meaning: The cookie is only ever transmitted between browser and server over HTTPS. Only available to script running on HTTPS page.

  • Can be set as HTTP only, meaning: Cookie is not visible to script running within the web page. Only visible within HTTP headers.

A cookie can be session or persistent:

  • Session cookies last until the browser is closed.

  • Persistent cookies last until a future expiry date, hence between browser instances.

A cookie can be first or third party

  • A first party cookie is one which is in the same domain (or sub-domain) of the page being displayed by the browser.

  • A third party cookie is one which is not in the same domain as the page being displayed by the browser.

7.3.2. Use of cookies within Celebrus

Celebrus stores no sensitive data in cookies. No user identification details. No authentication information. Celebrus data collection requires no authentication.

Cookies are used to maintain session context. Session context can be extended beyond the usual domain scope of a cookie by using the cross-domain feature. The cross-domain feature makes use of additional cookies set in the host of the Collection Server. If the Collection Server is hosted on a different domain to the website, the cross-domain cookies are considered third party by the browser which may reduce the effectiveness of cross-domain.

The following table details the contents of each cookie and its context and value components. When set within as the value of a cookie, these components are concatenated together using an underscore delimiter, with all cookie names prefixed with CSA name.

Cross domain cookies are set using the httpOnly flag. 1st party cookies are not set with this flag as they are accessed by the Celebrus JavaScript executing within the web page.
COOKIE PARTY SCOPE DETAILS

cdPersisted

3rd

persisted

Tracks a browser across multiple domains.

Value: [realtimeID] [uniqueDeviceID]

Set by: Set-Cookie HTTP headers
Attributes: SameSite=NONE, HttpOnly

cdSession

3rd

session

Tracks a session across domains.

Value: [sessionNumber] [lastActivityLocalTimestamp] [sessionStartServerTimestamp] [loadBalancerID] [sessionKey]

Set by: Set-Cookie HTTP header
Attributes: SameSite=NONE, HttpOnly

persisted

1st

persisted

Tracks a given browser across sessions.

Value: [realtimeID] [uniqueDeviceID] [acquisitionServerTimestamp] [recencySessionNumber] [recencyServerTimestamp] [frequency]

Set by: Set-Cookie HTTP header if the web page’s ETLD+1 matches a collection endpoint, otherwise via JavaScript
Attributes: SameSite=STRICT

session

1st

session

Tracks current session, relating pages and events.

Value: [sessionNumber] [lastActivityLocalTimestamp] [sessionStartServerTimestamp] [loadBalancerID] [sessionKey]

Set by: JavaScript
Attributes: SameSite=STRICT

initialsessioncookietest

1st

session

Used to determine whether browser supports session cookies. Only present for a fraction of a second.

initialpersistedcookietest

1st

persisted

Used to determine whether browser supports persistent cookies. Only present for a fraction of a second.

SF

1st

session

Data collection for current session has been shutdown due to an error.

P3P

1st or 3rd

persisted

Expressed consent of the visitor. See Data collection consent for further details.

For opted out users the value is optedOut

P3PInfo

1st

session

A millisecond value indicating the time the current session opted out.

Only appears for opted out users

For opted out users only the P3P and P3PInfo cookies are present.

Upon go() and doReinit() invocations, Celebrus script re-determines availability of session and persistent cookies. When both are supported, Celebrus uses the browser’s cookie store for context and device tracking (if enabled), otherwise the script uses session and local storage for context and device tracking.

Celebrus is capable of collecting a wide variety of data from the mobile apps, including data entered by the visitor and information displayed to them.

It is essential that due care is exercised in the storage and use of collected data. In many geographies this is a legal responsibility placed on you by local legislation.

Data input elements defined as passwords do not have data collected from them, with any interactions being recorded as three asterisks. It is a requirement of your Celebrus licence agreement that the use of Celebrus software on your site is included in any privacy statement . Ensure that your intended use of collected data is appropriately declared and in accordance with any applicable legislation.

Celebrus makes it possible to align with data protection regulations such as GDPR:

  1. Support for consent within mobile apps, through the use of a Consent API.

  2. Configuration is supported in the Data Protection App in the Configuration Manager:

    1. Whether device tracking is permitted for opted in visitors.

    2. Whether physical location tracking is permitted for opted in visitors.

    3. Default consent, if no explicit consent has been expressed by the visitor.

  3. If a visitor’s consent is anonymous, device and physical location tracking is not permitted.

  4. Events are present on the event stream when consent changes during a session.

  5. Celebrus determines the consent of a visitor by considering DNT setting, website first party P3P cookie, then collection host third party cookie.

    1. The first explicit setting is used.

    2. If there is no explicit setting, the system default is used.

8.1. Do Not Track web browser settings

As defined by https://www.w3.org/TR/tracking-dnt/, a browser setting through which the user can indicate their preference not to be tracked. As this is set on the browser, it is carried with the visitor’s browsing activities across all web sites visited through its inclusion as the DNT HTTP header on all outbound requests. With the Launch of Internet Explorer 10, Microsoft set Do Not Track as its default setting. This, according to the author of the DNT standard, violated DNT’s use, because it does not protect an individual’s privacy unless the recipients believe it was set by a real human being expressing their preference.

Celebrus can be configured to adhere to the DNT browser setting, or to adhere to all browsers except Internet Explorer 10 and above, or to never adhere to the setting.

8.2. Platform for Privacy Preferences

The data collection technology uses first party session cookies to maintain session context, and optionally first party persistent cookies to assist in building longer term profiles of visitors. If first party session cookies are not accepted by the visitor’s browser, the data collection silently shuts down.

The Platform for Privacy Preferences (P3P) is one mechanism which can help ensure such cookies are permitted. By using appropriate P3P HTTP response headers within the website describing the data being collected and the usage intent as per www.w3c.org/p3p visitors can make more of an informed choice.

Providing facilities to allow the visitor to opt out of data collection and advertising this within the P3P HTTP response headers can also be expected to increase cookie acceptance rates.

Integrated data collection consent mechanisms are included within the Celebrus system. There are two approaches to making use of this mechanism.

Data collection consent can be controlled using first party persistent cookies in the domain of your website.

This approach is beneficial in that it is first party and the user experience of your website can be maintained during the consent decision process. It gives you the ability to synchronise Celebrus to the consent your website visitor may have expressed in a different channel. Opting-out in this manner only impacts the brand of the website, not all brands using the same Collection Server. You are responsible for controlling consent between your domains.

The cookie which controls consent is called [csaName]P3P. See Before you begin for details of the prefix csaName.

The consent cookie can be assigned one of the following three values:

  • optedOut
    No data is collected.

  • anonymous
    Any data which could be used to identify the individual is removed from the collected data.

  • optedIn
    Full data collection.

If the cookie is not present, consent is controlled by the Collection Server’s data protection default consent setting. A change in P3P value is evaluated by Celebrus when a page loads.

Window scope functions exist which set the consent cookie value appropriately.

To use this approach it is necessary to set consent prior to Celebrus starting. For further information see Structure of the CelebrusInsert.js.
Opt out

To programmatically invoke the CSA to opt the current user out of collection for the current website, call the [csaName]optOut function:

[csaName]CelebrusApi.optOut();
Anonymous

To set the anonymous cookie call:

[csaName]CelebrusApi.anonymous();
Opt in

To set the optedIn cookie, call:

[csaName]CelebrusApi.optIn();

When invoked these functions automatically re-initialise the CSA, causing a synthetic page loading event forcing the system to re-evaluate the configuration.

Each of the three functions can take two optional arguments:

domain

You can specify an explicit domain on which the P3P opt out cookie should be set by passing it as an argument to the function, for example:

[csaName]CelebrusApi.optOut('.example.com');

In this example the P3P opt out cookie is set on the .example.com domain. If no domain is supplied the P3P cookie is set on the widest possible domain determined from the location.hostname. The widest domain is the effective top-level domain plus one (ETLD+1). For a website URL of the form https://www.example.com the top level domain is .com and ETLD+1 is example.com.

If a domain is specified, be sure to include a dot before the ETLD+1.

Similar calls can be used to programmatically set the anonymous and optedIn P3P cookies as required.

durationDays

If not specified the cookie is set for 20 years. You can specify your own cookie duration by passing it as an argument to the function. In the example below the consent cookie is set to optOut for domain .example.com, for a period of 365 days:

[csaName]CelebrusApi.optOut('.example.com', 365);

In the next example no domain is specified by using the undefined keyword, so the P3P cookie is set on the widest possible domain determined from the location.hostname. The cookie is set for a period of 365 days.

[csaName]CelebrusApi.optOut(undefined, 365);

See the Celebrus API functions table for more details.

The Celebrus system comes with a web page through which allows the visitor to opt out of data collection. Using this approach is a matter of just providing a link to the data collection URL of the form:

http://<Collection Server>/P3P_Options.html
p3p
This approach which uses third party cookies. It additionally does not integrate with any previous consent your digital presence may already have for the visitor. In light of current tracking prevention technologies its use is not recommended.

This opt out page can be styled as appropriate, by placing a replacement to use within each Collection Server installation:

<install directory>/CollectionServer/publicResources/P3P_Options.html

This approach operates by setting a third party persistent cookie indicating the data collection preference. This cookie is set in the data collection domain so controls data collection consent for the visitor’s device on all of an organisation’s brands which are using the same Collection Server domain. This may be viewed as a benefit or drawback depending upon the organisation’s viewpoint. The P3P cookie if set using this approach has a duration of 20 years.

8.4. Structure of the CelebrusInsert.js

The script is composed of three distinct parts:

  1. Self invoking function

  2. Configuration to the self-invoking function

  3. An invocation block

The script as delivered by the Celebrus servers can be included in the <HEAD> or <BODY> or each web page. The script when evaluated automatically starts the data collection.

If you wish to invoke a Celebrus API prior to it starting, for example when implementing Website integrated consent, simply place calls immediately prior to the invocation block.

Be sure to use the invocation block from your insert, as all window level variables and functions defined by Celebrus are prefixed with an installation dependent string known as a CSA Name.

The insert structure looks as shown below:

//
// Copyright Celebrus Technologies plc, all rights reserved
//
(function(celebrusConfigurationJSON)
{
 // SCRIPT HAS BEEN REMOVED FOR BREVITY
}
//==========
})(
// CONFIGURATION BLOCK STARTS
{
	"cookieCollectionPolicy": "ALL",
	"cookiesToCollect": [],
	"useSecureCookies": true,
	"useCompression": false,
	"csaName": "myCsaName",
	"endpointsArray": [{
		"domain": "celebrus.com",
		"url": "https://devtest.celebrus.com"
    }]
}
// CONFIGURATION BLOCK ENDS
);

// PLACE CALLS ON CELEBRUS APIs HERE

// CELEBRUS CSA INVOCATION BLOCK STARTS
window.myCsaNameGo();
//     ---------
// The underlined portion in the above code is the "CSA Name" that is configured for this CSA

// CELEBRUS CSA INVOCATION BLOCK ENDS

8.4.1. Configuration parameters

The parameters in the configuration block are automatically set according to the options selected in the Configuration UI. They can optionally be updated manually in the CelebrusInsert.js file if required

  • cookieCollectionPolicy specifies what first-party cookie data in each page will be collected. Can be one of three values: ALL, NONE or SPECIFIC. When SPECIFIC is chosen, the distinct cookie values to collect can be specified in the "cookiesToCollect" parameter

  • cookiesToCollect is an array of string values specifying the distinct first-party cookie values Celebrus should collect when present in the page. Used in conjunction with the SPECIFIC cookieCollectionPolicy.

  • useSecureCookies is a boolean value that indicates whether Celebrus should include the "secure" attribute when setting cookies using JavaScript.

  • useCompression is a boolean value which specifies whether Celebrus should use the CompressionStream API to compress event data being sent to the collection server if the browser supports it.

  • csaName - each installation is assigned a distinct csaName, the designated prefix applied to all top-level scoped variables and functions within the CSA.

  • endpointsArray lists the collection endpoints to be used to determine where Celebrus should send its collection data.

Celebrus collects only first-party cookie values which are visible to JavaScript. HttpOnly cookies will not be available for collection.

8.5. JSON Data API

The JSON Data API provides the ability to collect data other than that which is normally collected. Such data however is out of Celebrus control, and therefore whether it contains personally identifiable information (PII) is unknown. To cater for this the JSON API has been extended to add a further API:

[csaName]CelebrusApi.sendJsonData(jsonData, privacy)

The privacy type is an enumeration defined at window level:

window.CelebrusDataPrivacy

It provides the following two values:

MAY_CONTAIN_PERSONAL_DATA
ANONYMOUS_DATA_ONLY

The existing JSON API which takes a single argument defaults the DataPrivacy to MAY_CONTAIN_PERSONAL_DATA. Any data submitted through the sendJsonData API which may contain personal data is dropped unless the consent is opted in.

See the Celebrus API functions table for more details.

8.6. Hashed values

In circumstances where it is not appropriate to capture certain data, but a need exists to determine whether the data is the same across multiple fields (without knowing its value), Celebrus provides the ability to hash values. Hashing is lossy and should not be confused with encryption. Given a hash representing a value, is it not possible to directly reverse engineer the original value, though it is possible to guess what the value might have been and hash the guess to determine if the guess was correct.

8.7. Legitimate interest use cases

Regulations may require the informed consent of an individual prior to data collection. The General Data Protection Regulation (GDPR) is a good example of this. Data for other use cases such as fraud detection can, in the right circumstances, be collected using legitimate interest as the legal basis.

Celebrus addresses this requirement by supporting two instances of the CSA running within the same website. One instance is for marketing and supports user consent. The other instance is for legitimate interest use cases like fraud detection and does not require user consent.

Each CSA instance is configured to communicate with a separate Celebrus installation and act upon the data they receive accordingly.

The table below demonstrates the configuration differences between the two Celebrus installations:

ASPECT MARKETING USE CASE LEGITIMATE INTEREST USE CASES

Data collection

Configure data collection rules to meet your marketing objectives.

Configure data collection rules to meet your fraud detection needs.

Personalisation

Configure personalisation to meet your marketing objectives.

Personalisation not required.

User set consent

Integrate your website’s user consent approach with Celebrus.

Consent not required, the visitor is not required to opt in.

Server-side default consent

Configure default consent to meet regulations that apply to you.

Set default consent to opted in.

9. Event and data filtering

This permits the level of data capture to be tuned through the use of server-side collection rules. The rules are quite flexible, permitting matching on a URL, time of day or sample, and are configured within the Collection Rules app in the Configuration Manager.

The settings provided by the Collection Server are split into event and data filters.

COLLECTION FLAG FILTER TYPE DESCRIPTION

Navigates

Event

Script Load, Load Page, Before Unload, Unload, Navigator Info

Clicks

Event

Click, Double Click

Text Change

Event

Text Change

Key Events

Event

Key Up

Key Values

Data

Modifies values for Text Change and Key Up events — values are obfuscated (*) unless Key Values is checked

Hash Key Values

Data

Modifies values for Text Change and Key Up events — the SHA-256 hash value is used if both Hash Key Values and Key Values are checked

Submit and Reset

Event

Submit, Reset

Form Values

Event

Form Submit

Selects

Event

Select, Item Select

Default Selects

Event

Default Select (initial value of Select control)

Mouse Buttons

Event

Mouse Down, Mouse Up

Mouse Overs

Event

Mouse Overs

Network

Event

Network

Image Loads

Event

Image Load

Completes and Resize

Event

Document Complete, Images Loaded, Resize

Identified Elements

Event

HTMLElement

Errors

Event

Error (in-page Javascript error)

Mixed Mode Events

Event

The CSA uses SSL for all in-page events in a mixed-mode page.

If this is enabled, then the CSA attempts to send in-page events to the Collection Server using SSL. If the Collection Server does not have SSL enabled, the CSA shuts down for that page.

If this is disabled, the CSA makes no attempt to send in-page events for the mixed-mode page.

Media Player Events

Event

State Change

Timeline Navigation

Event

Timeline Navigate

CSA Heartbeat

Event

CSA Heartbeat

Session Storage

N/A

Directs the CSA to use the window.sessionStorage object for queuing outgoing events if session storage is supported.

Aggressive Collection

N/A

Directs the CSA to delay page unload process for a maximum of 500 milliseconds to improve collection of events fired while the page is unloading.

Social Media

Event

HTML Data Attributes

Event

Directs the CSA to include a property which lists any HTML5 data attributes defined for the target of the event.

Orientation

Event

Available within mobile devices, controls orientation monitoring of the device.

Gestures

Event

Available within mobile devices, controls pinch, swipe and pan events.

Event filters control whether the data event is captured, and as such only applies to automatically collected data. Manual use of the APIs is not filtered at the event level as they have already been captured.

Data filters control whether the data within the event is to be masked in any way and applies to both automatic and manually collected data.

All events and data are subject to filtering based on the active consent setting.

10. Content Security Policy

Content Security Policy (CSP) http://www.w3.org/TR/CSP/ is a widely supported browser standard, designed as an additional defence against malicious content in a web page by giving the website owner fine grained control over the way in which a page is expected to load its resources.

Celebrus data collection requires the following additions to you CSP:

  • script-src [collection domain]

  • img-src [collection domain]

  • connect-src [collection domain]

If personalisation is being delivered through Celebrus, and the content being delivered is limited to text and images, no further additions are necessary. If however the content includes JavaScript, the script-src policy entry must be extended to include unsafe-inline:

  • script-src unsafe-inline [collection domain]

If the content includes JavaScript that makes use of eval, the script-src policy entry is extended once more to include unsafe-eval:

  • script-src unsafe-inline unsafe-eval [collection domain]

Any policy additions must be reviewed in the context of your existing CSP.

11. API for manual data collection

Celebrus automatically collects data without the need for the site owner to manually tag the website. However this approach only works if the required data is surfaced within the website. There may be circumstances where having more control is beneficial. As such an API is provided by the CSA permitting manual data collection. It’s use should be minimal if at all, as the automatic data collection should be ample in nearly all circumstances. See the Celebrus API functions table for more details.

These APIs should only be used as an exception. The vast majority of data, if not all, is available through the automated collection. Using both the manual APIs and automated collection can lead to data duplication if done without due care.

11.1. Clicks

11.1.1. Click event on an element

To generate a click event on an element in the page simply pass the element’s object to the [csaName]Click method. Note that the element is not clicked on as far as the browser is concerned, only a click event is generated with the element’s attributes captured.

var targetObj = document.getElementById('exampleID');

if ([csaName]CelebrusApi) {
  [csaName]CelebrusApi.click(targetObj);
}

11.1.2. Synthetic click event

A click can be generated synthetically without the existence of a real element by creating a simple Object and assigning attributes to it.

var targetObj = new Object();
targetObj.name = 'exampleName';
targetObj.id = 'exampleID';
targetObj.alt = 'exampleAltText';
targetObj.tagName = 'IMG';

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.click(targetObj);
}

The full set of attributes which are available to be set are as detailed below. If additional attributes exist on the Object they are ignored.

name

A string indicating the name attribute of the target object for the event.

Optional

id

A string indicating the id attribute of the target object for the event.

Optional

value

A string, number or boolean indicating the source value that should be assigned.

Optional

tagName

A string indicating the tagName that should be associated with the target object for the event.

Defaults to BODY if not provided.

type

A string indicating the type attribute of the target object for the event.

Optional

href

A string indicating the href attribute of the target object for the event.

Optional

src

A string indicating the src attribute of the target object for the event. Typically this is only relevant for <img> and <input type="image"> elements.

Optional

checked

A boolean indicating the checked value of the target object for the event. Typically this is only relevant for checkbox or radio button input types

Optional

11.2. Text changes

A text change event represents the text entered into a text component and is automatically generated by Celebrus when focus is lost from the component.

11.2.1. Text change event on an element

To generate a text change event on a text element in the page simply pass the element’s object to the [csaName]textChange method. The object must be a Text, TextArea or Password control otherwise no event is generated. For Password controls only asterisks are recorded for the value.

var targetObj = document.getElementById('exampleID');

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.textchange(targetObj);
}

11.2.2. Synthetic text change

A text change can be generated synthetically without the existence of a real text element by creating a simple Object and assigning attributes to it.

var targetObj = new Object();
targetObj.name = 'exampleName';
targetObj.id = 'exampleID';
targetObj.value = 'some example text';
targetObj.tagName = 'input';
targetObj.type = 'text';

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.textchange (targetObj);
}

The full set of attributes which are available to be set are as detailed below. If additional attributes exist on the Object they are ignored.

name

A string indicating the name attribute of the target object for the event.

Either name or id must be provided.

id

A string indicating the id attribute of the target object for the event.

Either name or id must be provided.

value

A string, number or boolean indicating the source value that should be assigned.

Optional

tagName

A string indicating the tagName that should be associated with the target object for the event.

Mandatory - must be one of be textarea or input.

type

A string indicating the type attribute of the target object

Optional - dependent on the tagName specified. If the tagName is input the type specified should be either text or password.

11.3. Item selects

11.3.1. Item select event for an element

To generate an item select event on an element in the page simply pass the element’s object to the [csaName]select method. Note that a selection is not made on the element as far as the browser is concerned, only an item select event is generated with the element’s attributes captured.

var targetObj = document.getElementById('exampleID');

if ([csaName]CelebrusApi) {
  [csaName]CelebrusApi.select(targetObj);
}

11.3.2. Synthetic item select event

An item select event can be generated synthetically without the existence of a real element by creating a simple Object and assigning attributes to it:

var selectObj = new Object();
selectObj.type='select-one';
selectObj.tagName='SELECT'
var valuesArray = ['zero', 'one', 'two'];
var optionsArray = [];

for(var loop = 0; loop < valuesArray.length;loop++) {
  var newOption = document.createElement('OPTION');
  newOption.index = loop;
  newOption.text = valuesArray[loop];
  newOption.value = valuesArray[loop];

  if(loop == 1) {
    newOption.selected = true;
  }
  optionsArray[loop] = newOption;
}

selectObj.options = optionsArray;
selectObj.selectedIndex = 1;

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.select(selectObj);
}

The full set of attributes which are available to be set are as detailed below. If additional attributes exist on the Object they are ignored.

name

A string indicating the name attribute of the target object for the event.

Either name or id must be provided.

id

A string indicating the id attribute of the target object for the event.

Either name or id must be provided.

tagName

A string indicating the tagName that should be associated with the target object for the event

Mandatory - must be SELECT.

type

A string indicating the type attribute of the target object.

Mandatory - must be select-one or select-multiple.

selectedIndex

A number indicating the selected index within the options array.

Mandatory.

options

An array containing the options defined for the select control. Each individual option defined in the array must include index, text, and value properties

Mandatory

11.4. Form submits

A form submit represents the state of one or more fields as they are submitted by the user.

11.4.1. Form submit using an element

To generate a form submit event on a form element in the page simply pass the element’s object to the [csaName]formsubmit method. The object must be a form otherwise no event is recorded.

var targetObj = document.forms['exampleName'];

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.formsubmit(targetObj);
}

11.4.2. Synthetic form submit

A form submit can be generated synthetically without the existence of a real form object by creating a simple Object and assigning attributes to it.

var simulatedForm = new Object();
simulatedForm.name = 'artificialForm';
simulatedForm.elements = new Array();
var element1 = new Object();
element1.name = 'Search';
element1.id = 'SearchID';
element1.value = 'extra long trousers';
element1.type = 'text';
elementsToAdd[0] = element1;
var element2 = new Object();
element2.name = 'SearchType';
element2.id = 'SearchTypeID';
element2.value = 'simple';
element2.type = 'text';
elementsToAdd[1] = element2;

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.formsubmit(simulatedForm);
}

The full set of properties which are available to be set are as detailed below. If additional properties exist on the Object they are ignored.

name

A string indicating the name of the form being submitted A form name is used to identify a specific form within the document.forms array, thereby allowing individual elements within the form to be referenced in JavaScript.

Optional

id

A string indicating id of the form being submitted. An id should be unique within a page and allows a form to be directly referenced using the JavaScript document.getElementById function.

Optional

elements

An array of elements corresponding to form controls.

Required

Where each element is an object providing the attributes:

name

A string indicating the name attribute of the form element being described. The name attribute does not have to be unique within a form. In HTML, only form elements with a name attribute have their values passed when the form is submitted.

Optional

id

A string indicating the id attribute of the form element being described. Unlike names, the id of a form control should be unique.

Optional

type

One of: button, checkbox, color, date, datetime, datetime-local, email, file, hidden, image, month, number, password, radio, range, reset, search, submit, tel, text, time, url, week.

Required

value

The value to be assigned for the control being described.

Required

11.5. Navigates

Single page applications are supported through data collection configuration from Celebrus version 9.1, removing the need to add the manual code in this section.

Single page web application typically change the page URL with bookmarks to reflect their state changes. A bookmark within a URL is denoted by a #, as shown in the example below:

https://mywebsite.com/books/harrypotter.html#thePlot

If the user presses the back button in the web browser, the app reverts its state to the previous bookmark. In these or similar cases, it may be required that the collected data reflect these app state changes also by generating a new page in the collected data, hence synthetically producing a navigate. To achieve this the following needs to be invoked whenever a navigate is to be synthetically generated:

if([csaName]CelebrusApi)
{
  [csaName]CelebrusApi.doReInit();
}

Alternatively the window.location.href location can be listened to and a new page generated using the approach below:

(function() // Create a scope so location is not global
 {
   var location = window.location.href;
   setInterval(function() {
   if (location != window.location.href) {
     location = window.location.href;
     [csaName]CelebrusApi.doReInit();
   }
  }, 100);
 })();

11.5.1. Callback on CSA reinit

The Celebrus API allows you to register a callback function to be invoked after the CSA has executed the 'doReInit' process.

One use-case in which this may be useful is where you use a JSON data event to send a summary of data layer information when the page loads. In this case you will want to automatically send a new JSON data event when the CSA reinitialises and that can be achieved by registering the function that generates the JSON data event as the OnReInitCallback function.

Register a callback function to be executed after the CSA reinitialises using the 'registerOnReInitCallback' API function like this:

if([csaName]CelebrusApi)
{
  [csaName]CelebrusApi.registerOnReInitCallback(callbackFunction);
}

The callbackFunction provided will be invoked without any arguments.

11.5.2. Force a new session

A new session is automatically started by the CSA if one doesn’t exist, or the existing one has reached its idle timeout or max session duration. It’s also possible to programmatically force a new session by invoking doReinit(true) using the Celebrus API, as shown below:

if([csaName]CelebrusApi)
{
  [csaName]CelebrusApi.doReInit(true);
}

11.6. E-commerce

Basket actions can be provided directly to the system as shown in the following examples.

It is often convenient to wrap this JavaScript required for each type of action into a reuseable API, perhaps only surfacing the parameters which are used by your organization, defaulting others such as currency appropriately.

Celebrus provides an example wrapped API which can be downloaded from the Collection Server. This should be viewed as just a starting point, and not sourced from the Collection Server in a live production environment.

Data provided through this API is only collected if the consent status for the session is opted in.

See the Celebrus API functions table for more details.

11.6.1. Add product to basket

Represents a product being added to the basket. If multiple products are added to a basket an add event should be created for each product.

To generate an add to basket simply invoke the [csaName]CelebrusApi.event function passing an appropriately configured object, as show in the JavaScript below:

var eventObj = new Object();
eventObj.action = 'add';
eventObj.productID = addedProductID;
eventObj.value = addedValue;
eventObj.currency = addedCurrency;
eventObj.productDisplayName = displayName;
eventObj.skuNumber = skuNum;
eventObj.quantity = addedQuantity;
eventObj.valuePerItem = valueIsPerItem;
eventObj.targetContainer='basket';

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.event(eventObj);
}

The full set of available properties are detailed below:

PROPERTY PURPOSE NOTES

action

A string indicating the type of action performed.

Must be set to add.

productID

A string indicating the product identifier for the item added.

Required

value

A string indicating the monetary value of the item added.

Required

productDisplayName

A string giving a user friendly description of the item added.

Optional

skuNumber

A string indicating the SKU number for the item added.

Optional

quantity

The number of items added in this step.

Optional - defaults to 1.

currency

A string indicating the currency of the value entered.

Optional

valuePerItem

A boolean which should be true if the value property supplied is per item, and false if the value is a total.

Optional

targetContainer

Indicates whether target is basket or wishlist.

basket

11.6.2. Add product to basket failure

Representing a failed of a previous add to basket, can be generated as shown in the JavaScript below:

var eventObj = new Object();
eventObj.action = 'failedAdd';
eventObj.productID = addedProductID;

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.event(eventObj);
}

The full set of properties are detailed below:

action

A string indicating the type of action performed.

Must be set to failedAdd.

productID

A string indicating the product identifier for the item added.

Required

11.6.3. Amend product in basket

Represents the changing of quantity of a product in the basket. This can be generated simply as shown in the JavaScript example below:

var eventObj = new Object();
eventObj.action = 'amend';
eventObj.productID = amendedProductID;
eventObj.newQuantity = updatedQuantity;

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.event(eventObj);
}

The full set of properties are detailed below:

PROPERTY PURPOSE NOTES

action

A string indicating the type of action performed.

Must be set to amend.

productID

A string indicating the product identifier for the item amended.

Required

newQuantity

The new quantity for the item amended.

Required

11.6.4. Remove product from basket

This event can be generated simply as shown in the JavaScript example below:

var eventObj = new Object();
eventObj.action = 'remove';
eventObj.productID = removedProductID;

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.event(eventObj);
}

The full set of properties are detailed below:

action

A string indicating the type of action performed.

Must be set to remove.

productID

A string indicating the product identifier for the item added.

Required

targetContainer

Indicates whether target is basket or wishlist.

basket

11.6.5. Product in basket

Represents an item present in the basket when the page loads.

function reportProductInBasket(productID, displayName, group, currency, quantity, skuNum, valuePerItem, availabilityMsg, shippingMsg, savingMsg)
{
  var eventObj = new Object();
  eventObj.action = 'productInBasket';
  eventObj.productID = productID;
  eventObj.productDisplayName = displayName;
  eventObj.group = group;
  eventObj.currency = currency;
  eventObj.quantity = quantity;
  eventObj.skuNumber = skuNum;
  eventObj.value = valuePerItem;
  eventObj.availabilityMsg = availabilityMsg;
  eventObj.shippingMsg = shippingMsg;
  eventObj.savingMsg = savingMsg;

  if([csaName]CelebrusApi)
    [csaName]CelebrusApi.event(eventObj);
  }
}
PROPERTY PURPOSE NOTES

action

A string indicating the type of action performed.

Must be set to productInBasket.

productID

A string indicating the product identifier for the item added.

Required

value

A string indicating the monetary value of the item in the basket.

Required

productDisplayName

A string giving a user friendly description of the item added.

Optional

group

A string giving a user friendly description of the item group for the item added.

Optional

currency

A string indicating the currency of the value entered.

Optional

quantity

The number of items added in this step.

Optional - defaults to 1.

skuNumber

A string indicating the SKU number for the item added.

Optional

availabilityMsg

An optional string value recording availability details shown to the visitor.

Optional

shippingMsg

An optional string value recording shipping details shown to the visitor.

Optional

savingmsg

An optional string value recording savings details shown to the visitor.

Optional

11.6.6. Product view

Represents a product viewed by the visitor but not yet added to the basket.

function reportProductView(productID, displayName, group, currency, quantity, skuNum, value, availabilityMsg, shippingMsg, savingMsg)
{
  var eventObj = new Object();
  eventObj.action = 'productView';
  eventObj.productID = productID;
  eventObj.productDisplayName = displayName;
  eventObj.group = group;
  eventObj.currency = currency;
  eventObj.quantity = quantity;
  eventObj.skuNumber = skuNum;
  eventObj.value = valuePerItem;
  eventObj.availabilityMsg = availabilityMsg;
  eventObj.shippingMsg = shippingMsg;
  eventObj.savingMsg = savingMsg;

  if([csaName]CelebrusApi)
    [csaName]CelebrusApi.event(eventObj);
  }
}
PROPERTY PURPOSE NOTES

action

A string indicating the type of action performed.

Must be set to productView.

productID

A string indicating the product identifier for the item viewed.

Required

value

A string indicating the monetary value of the item viewed.

Required

productDisplayName

A string giving a user friendly description of the item viewed.

Optional

group

A string giving a user friendly description of the item group for the item viewed.

Optional

currency

A string indicating the currency of the value entered.

Optional

quantity

The number of items being viewed.

Optional - defaults to 1.

skuNumber

A string indicating the SKU number for the item viewed.

Optional

availabilityMsg

An optional string value recording availability details shown to the visitor.

Optional

shippingMsg

An optional string value recording shipping details shown to the visitor.

Optional

savingmsg

An optional string value recording savings details shown to the visitor.

Optional

11.6.7. Basket total

Represents the basket total. This can be generated simply as shown in the JavaScript example below:

var eventObj = new Object();
eventObj.action = 'basketTotal';
eventObj.totalValue = basketTotalVal;
eventObj.currency = basketCurrency;

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.event(eventObj);
}

The full set of available properties are detailed below:

action

A string indicating the type of action performed.

Must be set to basketTotal.

totalValue

A string indicating the the total value of the basket.

Required

currency

A string indicating the currency of the value entered.

Optional

11.6.8. Basket checkout

Represents the basket summary when the user starts the process of purchasing the items.

function reportBasketCheckout(basketTotalVal, basketCurrency, basketID, shippingCost, tax, deliveryType, paymentType, shippingAddress, billingAddress)
{
  var eventObj = new Object();
  eventObj.action = 'basketCheckout';
  eventObj.totalValue = basketTotalVal;
  eventObj.currency = basketCurrency;
  eventObj.basketID = basketID;
  eventObj.shippingCost = shippingCost;
  eventObj.tax = tax;
  eventObj.deliveryType = deliveryType;
  eventObj.paymentType = paymentType;
  eventObj.shippingAddress = shippingAddress;
  eventObj.billingAddress = billingAddress;

  if([csaName]CelebrusApi)
    [csaName]CelebrusApi.event(eventObj);
  }
}
PROPERTY PURPOSE NOTES

action

A string indicating the type of action performed.

Must be set to basketCheckout.

totalValue

A string indicating the monetary value of the item purchased.

Required

currency

A string indicating the currency of the item value.

Optional

basketID

A string indicating the basket identifier for the basket.

Optional

shippingCost

A string indicating the shipping costs for the basket.

Optional

tax

A string indicating the tax for the basket.

Optional

deliveryType

A string indicating the delivery option selected for the basket.

Optional

paymentType

A string indicating the payment option selected for the basket.

Optional

shippingAddress

A string indicating the delivery address selected for the basket.

Optional

billingAddress

A string indicating the billing address selected for the basket.

Optional

savingmsg

An optional string value recording savings details shown to the visitor.

Optional

11.6.9. Basket clear

Indicates that the current basket has been cleared, for instance if the site deems the basket abandoned or is rejected for any reason.

var eventObj = new Object();
eventObj.action = 'clear';
eventObj.reason = reason;
eventObj.targetContainer='basket';

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.event(eventObj);
}

11.6.10. Purchase

Represents the total value of all items in the basket at the time the purchase occurred. It can be generated simply as shown in the JavaScript example below:

var eventObj = new Object();
eventObj.action = 'purchase';
eventObj.orderNumber = orderNum;
eventObj.totalValue = basketTotalVal;
eventObj.currency = basketCurrency;

if([csaName]CelebrusApi) {
  [csaName]CelebrusApi.event(eventObj);
}

The full set of available properties are detailed below:

PROPERTY PURPOSE NOTES

action

A string indicating the type of action performed.

Must be set to purchase.

orderNumber

A string indicating the order number assigned for the purchase.

Required

totalValue

A string indicating the total value of the basket.

Required

currency

A string indicating the currency of the purchase.

Optional

11.6.11. Add product to wishlist

Represents adding a product present to a wishlist. If multiple products are added to a wishlist, then an add event should be created for each product.

To generate an add to wishlist event , invoke the [csaName]event method passing an appropriately configured object, as show in the JavaScript below:

function reportWishlistAdd(addedProductID, displayName, group, addedCurrency, skuNum, addedValue)
{
  var eventObj = new Object();
  eventObj.action = 'add';
  eventObj.targetContainer = 'wishlist';
  eventObj.productID = addedProductID;
  eventObj.productDisplayName = displayName;
  eventObj.group = group;
  eventObj.currency = addedCurrency;
  eventObj.skuNumber = skuNum;
  eventObj.value = addedValue;

  if([csaName]CelebrusApi) {
    [csaName]CelebrusApi.event(eventObj);
  }
}

The full set of available properties are detailed below:

PROPERTY PURPOSE NOTES

action

A string indicating the type of action performed.

Must be set to add.

targetContainer

A string indicating that the target for this action is a wishlist.

Must be set to wishlist.

productID

A string indicating the product identifier for the item added.

Required

value

A string indicating the monetary value of the item added.

Required

productDisplayName

A string giving a user friendly description of the item added.

Optional

group

A string giving a user friendly description of the item group for the item added.

Optional

skuNumber

A string indicating the SKU number for the item added.

Optional

currency

A string indicating the currency of the value entered.

Optional

11.6.12. Remove product from wishlist

Represents removing an item from a wishlist.

function reportWishlistItemRemoved(removedProductID)
{
  var eventObj = new Object();
  eventObj.action = 'remove';
  eventObj.productID = removedProductID;
  eventObj.targetContainer = 'wishlist';

  if([csaName]CelebrusApi)
    [csaName]CelebrusApi.event(eventObj);
  }
}

The full set of properties are detailed below:

action

A string indicating the type of action performed.

Must be set to remove.

targetContainer

A string indicating that the target for this action is a wishlist.

Must be set to wishlist.

productID

A string indicating the product identifier for the item added.

Required

11.6.13. Product in wishlist

Represents an item present in the wishlist when the page loads.

function reportProductInWishlist(productID, displayName, group, currency, skuNum, valuePerItem)
{
  var eventObj = new Object();
  eventObj.action = 'productInWishlist';
  eventObj.productID = productID;
  eventObj.productDisplayName = displayName;
  eventObj.group = group;
  eventObj.currency = currency;
  eventObj.skuNumber = skuNum;
  eventObj.value = valuePerItem;

  if([csaName]CelebrusApi)
    [csaName]CelebrusApi.event(eventObj);
  }
}
PROPERTY PURPOSE NOTES

action

A string indicating the type of action performed.

Must be set to productInWishlist.

productID

A string indicating the product identifier for the item.

Required

value

A string indicating the monetary value of the item.

Required

productDisplayName

A string giving a user friendly description of the item.

Optional

group

A string giving a user friendly description of the item group for the item.

Optional

currency

A string indicating the currency of the value.

Optional

skuNumber

A string indicating the SKU number for the item.

Optional

12. JSON Data API

Celebrus comes with a wide ranging set of data automatically captured straight out of the box. But what if additional data outside of the concepts natively supported by Celebrus is required?

The Celebrus platform knows the attributes for each type of event which can exist. It knows which attributes are mandatory and which aren’t. This is powerful because armed with this knowledge the platform can assist in both data governance, ensuring that the collected data adheres to the expected form, and also through user interfaces tailored to the type of data.

The typing system can be extended through user-defined events. Entirely new concepts can be described to the system. User-defined events are first class citizens in that they can be used within scenarios and within the Data Loader just like any other event.

User-defined events can be fed into the CSA using the method:

[csaName]CelebrusApi.sendJsonData(jsonData)

The JSON API is for use solely for generating user-defined and scenario Events. See the Celebrus API functions table for more details.

The single parameter jsonData can be either a JavaScript object or a JSON string. In the case of a JavaScript object, JSON.stringify is called on the object to generate the JSON string. The JSON string represents one or more events.

Each event is represented as a single array element. An event can be a simple set of name value pairs as shown below, or can be more complex.

{
  "events": [
    {
      "eventType": "NavigationTiming",
      "eventGroup": "Scenario",
      "NavigationType": 1,
      "StartTimeMillis": 1461940108060,
      "TotalDurationMillis": 2617,
      "Phase1UnloadDurationMillis": 1,
      "Phase2RedirectDurationMillis": 0,
      "Phase3AppCacheDurationMillis": 0,
      "Phase4DnsDurationMillis": 0,
      "Phase5ConnectDurationMillis": 0,
      "Phase6RequestDurationMillis": 13,
      "Phase7ResponseDurationMillis": 6,
      "Phase8ProcessingDurationMillis": 2372,
      "Phase9OnloadDurationMillis": 44
    }
  ]
}

The eventType and eventGroup attributes must always be specified. Other attributes may be set according to the event type. Only those attributes defined as Settable can be set by you within the JSON Data API call. All Settable and Mandatory attributes must be set.

Full documentation of events and their attributes can be found within the Configuration Manager UI, located within the Documentation tabs of the Data Enrichment, Data Loader and Data Streams apps.

The JSON Data API format is depicted in the railroad diagram below. Maps within maps are supported, along with tabular data:

railroad

13. Personalisation

The Celebrus CSA has a personalisation capability, allowing it to inject personalised content in to web pages. The personalised content is determined by Celebrus rules and integration with your decisioning systems. This is discussed in detail within the Real-Time User Guide.

The CSA has a built-in personalisation handler, which knows how to inject personalised content in to a web page. If you wish to take control of this process, you can specify your own personalisation handler as shown in the example below:

window.[csaName]CelebrusApi.registerPersonalisationCallback(callbackFunction);

In previous releases the registerPersonalisationCallback function was invoked using the [csaName]RTEHandler object like this:

window.[csaName]RTEHandler.registerPersonalisationCallback(callbackFunction);

This is still fully supported but the recommended approach is to use the CelebrusApi object.

When Celebrus receives personalisation content it will first check if a personalisation callback function has been registered. If one has, Celebrus will delegate the processing of the content to that callback and take no further action. If no callback is registered it will use the default Celebrus personalisation processing.

Celebrus will invoke a personalisation callback function passing a single argument - a JavaScript object containing the following properties

DATA DESCRIPTION

Context

executionRuleUUID

UUID string of a specific rule present in the system.

executionActionUUID

UUID string of a specific action present in the system.

executionContentUUID

UUID string of a specific piece of content, served up as a result of rule processing. This attribute is only set for content provided by the Real-Time Server content CSA. Data streams and third party application triggers do not populate this attribute.

executionCustomUUID

Base64-encoded string containing optional custom ID supplied by an external server that provides personalization content.

sessionKey

Identifier for the session which this action is to be applied to.

csaNumber

Identifier for the page instance which this action is to be applied to.

Placement

targetAttributes

An array of objects that describe the attributes of the target of the personalisation action, such as name, id, tagName.

Each object describes attributeType, attributeValue and an indicator if the value is a regular expression (attributeIsRegEx)

See com.speed_trap.commons.content.ObjectIdentificationType in the API documentation.

Action

A numeric string indicating the action being taken - replace (0), insert before (1), insert after (2), insert at top of page (3), insert at bottom of page (4).

See com.speed_trap.commons.content.ContentActionMethod in the API documentation.

Content

contentType

Type of the content such as image, text, JavaScript, HTML, XHTML, redirect.

See com.speed_trap.commons.content.ContentType in the API documentation.

content

String representing the content. In the case of image the content is a string referencing the source URL of the image.

replacementurl

If applicable, the URL to be shown when the content is clicked.

See the Celebrus API functions table for more details.

14. Visibility

Celebrus provides an API that allows you to direct the CSA to track changes in visibility for a particular element or piece of content within the page.

Celebrus defines an item as visible if its styling and size indicates that it is displayable and any part of the item appears within the current browser viewport.

The following table shows the style or property values which will cause an element to be considered 'not displayable':

STYLE or PROPERTY VALUE

style visibility

'hidden' or 'collapsed'

style display

'none'

style opacity

'0'

property hidden

true

property width

0

property height

0

property offsetWidth

0

property offsetHeight

0

To track changes in visibility for an object, register it with the Celebrus VisibilityManager instance in the page.

window.[csaName]VisibilityManager.register(objectToTrack)

The objectToTrack reference above is a direct reference to an Element within the web page. The VisibilityManager will determine the bounding rectangle for the element and decide its visibility based on whether it is within the current browser viewport and is displayable as described above.

When an object is registered the VisibilityManager will generate an event reporting its initial visibility state - visible or not visible. It will report further events for the object each time its visibility state changes, for instance if the object moves in or out of view when the user scrolls or resizes the page.

An event will be generated each time the VisibilityManager detects that the visible percentage of the monitored object has reached and maintained a new maximum value for a period of at least one second.

A final event for each registered object will be sent when the page is unloading.

To stop tracking a registered object which has been removed from the DOM, deregister it from the VisibilityManager like this:

window.[csaName]VisibilityManager.deregister(objectToTrack)

The VisibilityManager produces Web\ContentVisible events on the EventStream and have the following attributes:

ATTRIBUTE NAME IN EVENT DATA TYPE

ObjectHeight

Integer

ObjectWidth

Integer

ObjectAbsoluteX

Integer

ObjectAbsoluteY

Integer

ObjectFirstVisibleTimestamp

Long

ObjectIsVisible

Boolean

ObjectLastVisibleTimestamp

Long

ObjectMaximumContinuousVisibleTime

Long

ObjectTotalVisibleTime

Long

ObjectClass

String

ObjectID

String

ObjectName

String

ObjectMaximumVisiblePercentage

Double

ObjectMinimumVisiblePercentage

Double

ObjectPageVisibilityIndex

Integer

The Visibility API only works with items that are present in the DOM - if the object passed to the VisibilityManager is not part of the DOM it will disregarded.

The VisibilityManager will automatically deregister any items which it finds are not part of the DOM in the course of its measurements.

Celebrus automatically registers any personalisation content pushed into the page with the VisibilityManager.

15. Web browser support

The CSA technology is designed to adapt to the functionality of the browser in which it executes. As such the technology typically requires no modifications to support new browsers. Support for the most popular desktop browsers is detailed below: All modern browsers are supported.

BROWSER SUPPORTED VERSIONS

Internet Explorer

9+

Edge

12+

Chrome

7+

Safari

5.1+

Opera

8+

iOS Safari

6+

Android Browser

4+

Chrome for Android

18+

15.1. Data collection browser compatibility

The CSA is highly adaptable, using discovery techniques which adapt to the browser technology. There are only a few requirements for the full data collection to operate:

  1. Storage
    At least first party session cookies or session storage (if supported).
    Where cookies are unavailable, local storage may be used in addition to session storage to track activity of the device across web sessions.

  2. Execution
    JavaScript execution including exception handling and JSON support is required. Very early versions of some browsers such as Microsoft Internet Explorer 7 are not supported.

  3. Security
    For mixed-mode and SSL pages, TLS support is required within the browser.
    TLS1.0 and TLS1.1 are not supported by the Celebrus Collection Server by default as they are not considered secure nowadays. This excludes data collection from ancient browsers such as Internet Explorer 6.

15.2. Browsers not supporting JavaScript and Cookies

Like many websites, Celebrus requires JavaScript and session cookies or session storage to operate. For those browsers with cookies, session storage, and JavaScript disabled, no information is collected by Celebrus. If this is a concern then you should consider using the HTTP API to deliver data to Celebrus. See the Data Collection for HTTP API User Guide for more information.

15.3. Browsers pre-loading of web pages

Web browser may decide to pre-load web pages which although haven’t as yet been requested by the visitor, are anticipated to be requested. Celebrus automatically caters for this, recognising a page is pre-loading and only commencing data collection once the page is actually requested by the visitor.

16. Intelligent tracking prevention (ITP)

ITP is an Apple technology whose aim is to protect user privacy ensuring that data about their web activity is not acquired for purposes they never agreed to. It achieves this by restricting certain browser functions to third parties. ITP has undergone several revisions, each imposing further restrictions than the previous. Further information can be found at https://webkit.org/blog/category/privacy/.

ITP is applied to any browser technology running on Apple hardware.

ITP is an evolving technology whose behaviour could change in the future.

16.1. First party presence

To support ITP you must deploy Celebrus so that the collection endpoints align with your website domains. For example, if you deploy Celebrus to www.acme.com then the collection host collection.acme.com is aligned. Multiple collection endpoints can be configured and deployed. In such cases Celebrus determines the most appropriate endpoint to use for each web page.

Configure collection endpoints within the collection section of the Deployment app in the Configuration Manager. The CelebrusInsert.js must be redeployed once this configuration has been updated.

A single Celebrus installation can be known by different domains using CNAME DNS records which maps one domain name (an alias) to another. If Celebrus is terminating SSL a single certificate must be provided to Celebrus supporting all configured hosts using Subject Alternate Names. This certificate can be specific to the collection hosts only.

16.2. Long term visitor recognition

Long term visitor recognition functions if any one of the following conditions are met:

  • A visitor returns within seven days (if your collection endpoints are not aligned with your website domains).

  • A visitor returns within the Visitor tracking cookie duration, as configured within the collection settings in the Deployment app (if your collection endpoints are aligned with your website domains).

  • A visitor identifies themselves within their current visit and has identified themselves in at least one previous visit.

16.3. Session continuation cross domain

All ITP based devices and Firefox prevent session continuation cross domain using cookies. However it is possible to use first party link decoration to achieve the same effect of cross domain, when directly navigating between two domains within your organisation. Link decoration places a querystring parameter on page links between your organisations websites automatically, allowing cross domain to function without cookies. Link decoration only operates on links which are listed as a Celebrus collection endpoint. The value Celebrus places as a querystring parameter is a time-limited server-side reference.

In some cases you may not want Celebrus to automatically apply link decoration to all pagelinks between your organisations websites, for instance if a backend system expects link parameters in a defined order. When Use link decoraton is not enabled it is still possible to use the Celebrus Api to retrieve the link decoration value for the page and update the links you want manually. The example below shows link decoration being applied to a single target link where the csaName assigned for the installation is "csaName".

<a id="targetLink" href="https://www.example.com?key1=value1&key2=value2"> Example</a>

<script type="text/javascript">

if(window.csaNameCelebrusApi)
{
    let targetLink = document.getElementById("targetLink");

    if(targetLink)
    {
    	let updatedHref = window.[csaName]CelebrusApi.applyCrossDomainLinkDecorationToHref(targetLink.href);
        targetLink.href = updatedHref;
    }
}

</script>

16.4. Collection Endpoint selection

On the first page of a session, if there is no referrer that corresponds to one of the configured collection endpoints, the CSA selects the default collection endpoint, i.e. the first endpoint in the list, since this corresponds to the domain the company considers most likely to be a start point for customer sessions. Using this endoint maximises the chances for cross domain session recovery to recover a session number started on a different domain.

If the current page is not aligned to the default collection endpoint domain then ITP limits the persisted cookie expiry duration to seven days on that first page, but on navigation to further instrumented pages the system will have an opportunity to select the aligned collection endpoint and the cookie expiry duration will be set to the Visitor tracking cookie duration, as configured within the collection settings.

In summary, on the first page in a session the CSA maximises the chances for session recovery to succeed, while subsequent pages maximise cookie persistence.

17. Miscellaneous

17.1. Mouse pathing

A MousePath summarises the data for a series of mouse movements between a start and end point. It reports X/Y coordinates for the start and end points and uses the intermediate points captured to calculate characteristics of the path taken by the user.

mousePathing
  • MousePathVelocity is the pixels per second measure of the pointer movement between the two points in a MousePath

  • MousePathStandardDeviation is calculated for the intermediate points detected within the Mouse path from the straight line between the start and end points

  • MousePathJitterProportion reports the total distance variation of intermediate points detected within the Mouse path expressed as a proportion of the distance of the straight line between the start and end points

  • MousePathDeviationArea reports the total area defined by the intermediate points above and below the straight line between the start and end points

  • MousePathNumberOfCrossovers reports the number of times the line plotted between the intermediate points crosses the straight line between the start and end points

MousePath data is not collected for users who have selected Anonymous consent status.

17.2. Celebrus CX Vault

Celebrus CX Vault allows personalisation to be delivered to unconsented visitors by executing a signals model on the device rather than on Celebrus servers.

See the Celebrus CX Vault User Guide documentation for further information.

17.3. HTTP request headers

It is possible to set additional HTTP request headers to be used by the Celebrus insert when communicating with collection endpoints. To do this invoke the [csaName]setHttpRequestHeader(name, value) function on the insert, to add the headers you want. This must be done for each web page. To ensure all requests are made with your additional HTTP headers in place, ensure that you set the additional headers after the script has loaded but before it is started.

17.4. Website controlled data collection exclusions

The Celebrus Collection Server can be configured to include and exclude fields from data collection. This is server-side control. Another approach, or one which can be used in tandem with the server-side controls, is to express exclusions within the page delivered by the website.

Exclusions are specified by assigning one or more comma separated element IDs to the variable [csaName]collectExclude as shown in the JavaScript example below:

window.[csaName]collectExclude='customer.address*,customer.telephone*';

In the example above collection is excluded from any element on the page starting with customer.address or customer.telephone. Note that wildcards are permitted but only at either end of the identifier, and only whole segments may be wildcarded. Hence *.address.* is permitted whilst *address* is not.

Another alternate approach to exclude data collection is to add a special attribute(data-[csaname]-collect-exclude) in html input elements. This indicates the client CSA to escape events of marked elements in event stream and to exclude element data in FormSubmit events as well.

Name of the attribute depends on the csa name. If csaname is 'myTestCSA' then the attribute name is 'data-mytestcsa-collect-exclude' (all in lowercase). Here is a sample format of the html elemtent with attribute.

<input type='text' name='email' id='email' data-mytestcsa-collect-exclude>
<input type='checkbox' name='vehicle' value='bmwx6' data-mytestcsa-collect-exclude> BMW X6

17.5. Cordova app support

Apache Cordova describes itself as:

Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript. Combined with a UI framework such as jQuery Mobile or Dojo Mobile or Sencha Touch, this allows a smartphone app to be developed with just HTML, CSS, and JavaScript.

The CSA operates in a similar manner for an Apache Cordova app as it does for an HTML5 application. A few differences exist as highlighted below:

  • Apps in this environment have a location of file://<your application> and therefore the data collection licensing must accommodate this.

  • The use of cookies is not permitted with the CSA automatically switching to the use of session storage and local storage.

  • Control of the opt-in and opt-out process using local storage of the form:

    window.localStorage.setItem("[csaName]P3P", type);

    Where type is one of the following values:

    optedOut
    optedIn
    anonymous

17.6. RSS feeds

By including identifying criteria within the RSS <link> URLs, RSS feeds can be identified.

17.7. Dual running Celebrus systems

Celebrus supports multiple inserts running within the same website. This can be useful when upgrading between major Celebrus releases, as it gives you the opportunity to run with old and new Celebrus in parallel, to ease the adoption of latest Celebrus features and data. When setting up to dual run, the existing Celebrus device identifiers and user consent can be transferred from the incumbent Celebrus to the new, by using the CelebrusCopyCookies.js script. The script can be downloaded from the Collection Server, and hosted by your website. This script needs to be executed before the new Celebrus insert executes.

17.8. Celebrus API functions

The JS10 Celebrus API object was introduced in version 9.7.0 and sources all of the API functions in a single JavaScript object. This was done to ensure that Celebrus functions are contained and accessed from a distinct object rather than a series of functions and variables in the window scope, and to maintain a consistent approach for naming Celebrus API functions.

As documented in previous releases, Celebrus API functions are also available as a series of window-level functions prefixed with the CSA Name assigned for the installation. These window-level functions are still fully supported by the JS10 CSA, but using the CelebrusApi object is now the recommended way to call API functions.

The following table shows current function invocations and their JS9 equivalents.

All APIs must be prefixed with your deployment’s CSA name.
JS10 API JS9 API EQUIVALENT DESCRIPTION

CelebrusApi.optIn()

optIn()

Changes user to Opt in consent state.

CelebrusApi.optOut()

optOut()

Changes user to Opt out consent state.

CelebrusApi.anonymous()

anonymous()

Changes user to Anonymous consent state.

CelebrusApi.doReInit()

doReInit()

Reinitialises the CSA, See Navigates.

CelebrusApi.doReInit(true)

doReInit(true)

Generates a new session, See Force a new session.

CelebrusApi.registerOnReInitCallback(callbackFunction)

No JS9 equivalent

Registers a Callback on CSA reinit.

CelebrusApi.stop()

stop()

Stops the CSA’s operation and flags it as in a 'stopped' state. See Stop the CSA (Page).

CelebrusApi.clearStoppedState()

clearStoppedState()

Clears the CSA’s 'stopped' state flag, see Clearing stopped state.

CelebrusApi.start()

start()

Start the CSA.

CelebrusApi.eventQueueIdle()

eQI()

Returns true if there are currently no event requests queued. This may be useful for testing.

CelebrusApi.event(eventObject)

event(eventObject)

E-commerce.

CelebrusApi.click(eventObject)

click(eventObject)

Click event on an element.

CelebrusApi.select(eventObject)

select(eventObject)

Item select event for an element.

CelebrusApi.textChange(eventObject)

textchange(eventObject)

Text change event on an element.

CelebrusApi.formSubmit(eventObject)

formsubmit(eventObject)

Form submit using an element.

CelebrusApi.sendJsonData(jsonData, privacy)

SendJsonData(jsonData, privacy))

JSON Data API.

CelebrusApi.trackYouTubeIframePlayer(playerRef, playerId)

trackYouTubeIframePlayer(playerRef, playerId)

Registers a YouTube iframe player instance with the CSA. See the Data Collection for Media Players document.

CelebrusApi.getSessionNumber()

sn

Returns the current session number. This may be useful for testing.

CelebrusApi.getSessionKey()

contentKey

Returns the current session key. This may be useful for testing.

CelebrusApi.getRealTimeId()

No JS9 equivalent

Returns the identifier of the real time server currently assigned to process the session. This may be useful for testing.

CelebrusApi.getLoadBalancerId()

No JS9 equivalent

Returns the four digit load balancer ID incorporated into outgoing event requests to aid load balancing. This may be useful for testing.

CelebrusApi.getOptOutStatus()

optOutStatus

Returns current P3P consent state. This may be useful for testing.

CelebrusApi.tagContent(targetObject)

window.RTEHandler.tagContent(targetObject)

Tag the target object with properties holding the rule, action and content UUIDs for the Personalisation content currently being processed. See the Real-Time Personalisation User Guide.

CelebrusApi.registerPersonalisationCallback(callbackFunction)

RTEHandler.registerPersonalisationCallback(callbackFunction)

Registers an external Personalisation callback function to process personalisation responses.

CelebrusApi.getCrossDomainLinkDecoration()

No JS9 equivalent

Retrieves the link decoration name and value for the current session. This may be included as an extra querystring parameter in any links in the page if link decoration is not enabled in the page.

CelebrusApi.applyCrossDomainLinkDecorationToHref(hrefString)

No JS9 equivalent

Returns the result of applying the link decoration for the current session to the hrefString argument provided.

18. API keys

API keys enable you to restrict who sends events to the Collection Server from websites, apps and using the HTTP API. When API keys are enabled, every request containing event data originating from these technologies must include a valid API key.

API keys do not provide strong security because they are relatively easy to discover by analysing network packets sent from mobile applications. They do, however, add an additional hurdle for an adversary and they also block data accidentally sent to the wrong Collection Server.
API keys are managed in the Deployment app in the Configuration Manager (see Deployment App  Collection  API Keys). The Deployment app always allocates the API keys, they are not something which you choose.

When you create an API key, the Deployment app provides the API key as a 16 digit random identifier. Your client applications must be configured to send the API key in the HTTP request header called x-api-key.

The Deployment app supports multiple API keys. This allows you to use different API keys in different applications. It also enables you to introduce new API keys and leave the existing API keys active. Once there are no web pages or client applications using an old API key, you can remove it from the Deployment app.

18.1. Enforcement of API keys

The Deployment app has options which specify whether API keys are enforced for any or all HTML CSAs, App SDK and HTTP API requests. Enforcement ensures that requests sent to the Collection Server with an invalid or missing API key are rejected.

Requests with API keys which are in an invalid format are always rejected.

18.2. Rolling out to websites

You can use the enforcement option to introduce an API key to a website gradually. The Deployment app allows you to specify the default API Key to use in the CelebrusInsert.js file by selecting an entry from the list of the currently configured API Keys.

To roll out API keys to a website:

  1. Ensure that enforcement for HTML5 CSAs is disabled.

  2. Create an API key and choose it as the default API Key for HTML5 CSAs.

  3. Generate a new CelebusInsert file and deploy it to the website.

  4. Ensure all pages in the website have the new insert deployed

  5. Enable enforcement for HTML5 CSAs.