CX Tag Tracking Reference

The Oracle CX Tag is a JavaScript library which can be used to enable and configure various Oracle CX products on your website (for example, Oracle Infinity and Oracle Maxymiser).

This guide focuses on implementation for Oracle Infinity.

Implementing the CX Tag on your website?

See our Web Quick Start Guides to get the tag up and running quickly on your website.

Contents

CX Tag Features

This section details some of the core features of the CX Tag.

CX Tag Library Loader

Implementation

In order for the CX Tag to function, you need your CX Tag Library URL (see Generating Tags). This will look like this:

//d.oracleinfinity.io/infy/acs/account/{Account GUID}/js/{Tag ID}/odc.js?_ora.config={_ora.config}

Account GUID, Tag ID and Config
  • {Account GUID} identifies your account. All your tags will use the same account GUID so that all data collected for your account is stored together.

  • {Tag ID} allows you to assign access rights to your Oracle Infinity Tags and put them into a hierarchical format.

  • {_ora.config} denotes which Environment the tag is pointing towards (for example, analytics:test to allow you to point towards different tag configurations per Environment, for example, Test and Production). See What are Environments? for more detail.

You can use the above URL to load the JavaScript library within the <head>* as per the code template below:

Synchronous recommended

Synchronous CX Tag Library Load

<!-- CX Tag - Library Load --> <script type="text/JavaScript" src="//d.oracleinfinity.io/infy/acs/account/{Account GUID}/js/{Tag ID}/odc.js?_ora.config={_ora.config}"></script>

Asynchronous

<script type="text/JavaScript"> (function() { var accountGUID = "{Account GUID}"; var tagID = "{Tag ID}"; var config = "analytics:test"; // DO NOT EDIT BELOW THIS LINE for(var odc_requested=!1,scripts=document.getElementsByTagName("SCRIPT"),s=0;s<scripts.length;s++)scripts[s].src&&/oracleinfinity.*odc\.\js/.test(scripts[s].src)&&(odc_requested=!0);if(!odc_requested){var sc_scripts=document.getElementsByTagName("script")[0],sc=document.createElement("script");if(sc.async=!0,void 0===config)var config="";config&&(config="?_ora.config="+config),sc.src="//d.oracleinfinity.io/infy/acs/account/"+accountGUID+"/js/"+tagID+"/odc.js"+config,sc_scripts.parentNode.insertBefore(sc,sc_scripts)} }()); </script>
<script type="text/JavaScript"> (function() { var accountGUID = "{Account GUID}"; var tagID = "{Tag ID}"; var config = "analytics:test"; // DO NOT EDIT BELOW THIS LINE // Check if odc.js loaded var odc_requested = false; var scripts = document.getElementsByTagName('SCRIPT'); for (var s = 0 ; s < scripts.length; s++){ // find the script tags with a source that has odc.js? if (scripts[s].src && /oracleinfinity.*odc\.\js/.test(scripts[s].src)) { odc_requested = true; } } // Conditionally odc.js if(!odc_requested){ var sc_scripts = document.getElementsByTagName('script')[0]; var sc = document.createElement('script'); sc.async = true; if(typeof config === "undefined"){var config = "";} if(config){config = "?_ora.config=" + config}; sc.src = "//d.oracleinfinity.io/infy/acs/account/"+ accountGUID+"/js/"+tagID+"/odc.js"+config; sc_scripts.parentNode.insertBefore(sc, sc_scripts); } }()); </script>
*Synchronous or Asynchronous?

If you are going to be using Oracle Maxymiser then you must implement this in the <head> synchronously as per above to ensure the page content can be manipulated before it is visible to the user. However, if you’re not using Oracle Maxymiser then this can be asynchronous and not necessarily in the <head>.

If this is not feasible, please see Oracle Maxymiser CX Tag Guidelines or contact Oracle Consulting about an engagement to support you with your tagging requirements.

Testing

Watch the CX Tag Quick Start : Testing video playlist

See CX Tag Quick Start : Testing.

See Verifying and Debugging the CX Tag.

When you load the CX Tag Library, you can validate this is working by Inspecting the Network Activity in your browser and filtering for the odc.js for any requests.

  • Inspect the Network in your browser for odc.js:

    Debugging the CX Tag Library

    An image of debugging the CX Tag Library

View Call ora.view()

Implementation

Watch the CX Tag Quick Start : Triggering Virtual Page Views and Events video playlist

See CX Tag Quick Start : Triggering Virtual Page Views and Events.

Once you have implemented the CX Tag Library Loader on your website, in order to tell Oracle Infinity that someone has is viewing a page, you can make a View call (and optionally pass useful information about the user or the page in the request).

Making a Call

You can make a simple request using the following syntax:

Example Product View

// Declare Your Parameters (or leave object empty {}) var cxDataObject = { "wt.pn_sku":"SKU1", "wt.product_name":"big trainers", "wt.my_custom_var":"another variable" } // DO NOT EDIT BELOW THIS LINE - ORA.view() window.ORA=window.ORA||{productReady:[]};ORA.productReady.push(['analytics',function(cxDataObject){return function(){return ORA.view({"data":cxDataObject})}}(cxDataObject)]);
// Declare Your Parameters (or leave object empty {}) var cxDataObject = { "wt.pn_sku":"SKU1", "wt.product_name":"big trainers", "wt.my_custom_var":"another variable" } // DO NOT EDIT BELOW THIS LINE - ORA.view() window.ORA = window.ORA || { productReady: [] }; ORA.productReady.push(['analytics', function(cxDataObject) { return function() { return ORA.view({ "data": cxDataObject }) } }(cxDataObject)]);
cxDataObject is used to pass in your tracking parameters.

ORA.productReady.push()

The code under // DO NOT EDIT BELOW is used to ensure that the tracking call will dispatch regardless of whether the CX Tag Library (odc.js) has loaded or not. This allows the developer to not worry about whether the ORA.view() function exists or not.

You can also declare custom parameters. Refer to Data collection parameter syntax for details.

Testing

Watch the CX Tag Quick Start : Testing video playlist

See CX Tag Quick Start : Testing.

See Verifying and Debugging the CX Tag.

When you trigger a View Call, you can validate this is working by Inspecting the Network Activity in your browser and filtering for the dcs.gif for any requests.

  • Inspect the Network in your browser for dcs.gif:

    Debugging your Infinity Requests

    An image of debugging your infinity requests

If you have declared parameters, you’ll be able to see these later in the request as query-string parameters:

Seeing Your Parameters in the CX Tag Request

An image of seeing your parameters in the CX Tag Request

View Calls are identified by wt.dl=0 and Click Calls by wt.dl=1

All view calls will have the parameter wt.dl=0 whereas Click Calls will have the parameter wt.dl=1.

Click/Event Calls ORA.click()

Implementation

Watch the CX Tag Quick Start : Triggering Virtual Page Views and Events video playlist

See CX Tag Quick Start : Triggering Virtual Page Views and Events.

Once you have implemented the CX Tag Library Loader on your website, in order to tell Oracle Infinity that someone has performed an action (for example, a user his clicked on a menu item or has hovered over an image) you can make a Click call (and optionally pass useful information about the user, the page or the action itself in the request).

Making a Call

You can make a simple request using the following syntax:

Example Add To Cart Event

// Declare Your Parameters (or leave object empty {}) var cxDataObject = { "wt.tx_e":"a", "wt.pn_sku":"SKU1", "wt.product_name":"big trainers" } // DO NOT EDIT BELOW THIS LINE - ORA.click() window.ORA=window.ORA||{productReady:[]};ORA.productReady.push(['analytics',function(cxDataObject){return function(){return ORA.click({"data":cxDataObject})}}(cxDataObject)]);
// Declare Your Parameters (or leave object empty {}) var cxDataObject = { "wt.tx_e":"a", "wt.pn_sku":"SKU1", "wt.product_name":"big trainers" } // DO NOT EDIT BELOW THIS LINE - ORA.click() window.ORA = window.ORA || { productReady: [] }; ORA.productReady.push(['analytics', function(cxDataObject) { return function() { return ORA.click({ "data": cxDataObject }) } }(cxDataObject)]);
cxDataObject is used to pass in your tracking parameters.

ORA.productReady.push()

The code under // DO NOT EDIT BELOW is used to ensure that the tracking call will dispatch regardless of whether the CX Tag Library (odc.js) has loaded or not. This allows the developer to not worry about whether the ORA.click() function exists or not.

You can also declare custom parameters. Refer to Data collection parameter syntax for details.

Testing

See Testing View Calls for instructions on how to test Click/Event calls.

Frequently Asked Questions

What does a typical implementation of the CX Tag on a website look like?

Working with Tag Managers?

See our Web Quick Start Guides for implementation instructions using popular tag managers.

See below for a standard implementation:

Plain

<html> <head> <!-- CX Tag - Library Load --> <script type="text/JavaScript" src="//d.oracleinfinity.io/infy/acs/account/{Account GUID}/js/{Tag ID}/odc.js?_ora.config={_ora.config}"></script> </head> <body> ... <!-- CX Tag - Page View --> <script type="text/JavaScript"> (function(){ // Declare Your Parameters (or leave object empty {}) var cxDataObject = {}; cxDataObject["wt.pn_sku"] = "SKU1"; cxDataObject["wt.product_name"] = "big trainers"; // DO NOT EDIT BELOW THIS LINE - ORA.view() window.ORA = window.ORA || {productReady: []}; ORA.productReady.push(['analytics', function(cxDataObject) {return function() {return ORA.view({"data": cxDataObject})}}(cxDataObject)]); })(); </script> ... </body> </html>

What are Environments?

Environments allow you to run your tag in multiple configurations. In this example, you can have one version of a tag for a Test environment, where you can test and tag configurations you have in a test environment, and then another environment for your live site (Production), where you would promote your Test configuration to if working as you expected in the Test environment.

This is documented in more detail in Generating Tags, but you can see the different configurations you have for the different environments within the Data Collection Application:

Configs per Environments within the Data Collection Application

An image of configs per enviroments

What’s the difference between View and Click calls?

View calls will send a parameter of wt.dl=0 to denote a page view whereas Click/Event calls will send a parameter of wt.dl=1 to denote this is an event/click. It is important to only use View calls for page views as these can affect metrics such as Bounce Rate within Oracle Infinity Analytics.

Full View and Click Tracking Documentation

Please see View and Click within the Oracle Infinity Help Center for full tracking documentation.

How do I work with Single Page Applications (SPAs)?

Watch the CX Tag Quick Start : Single Page Application video playlist

See CX Tag Quick Start : Single Page Application Videos.

If your website is a single page application (that is, you are asynchronously changing the content on the page as viewers navigate instead of loading an entirely new page) then you can simply track this by using the CX Tag.

Simply:

  • Generate your Oracle CX Tag (ensuring the Tag Management Plugin is turned on).

  • Load the CX Tag Library Loader code upon page load (or the equivalent within a Tag Manager - see Quick Start Guides).

  • As the initial view loads, trigger a View call (with any parameters you’d like to declare in the request).

  • As users change view, trigger additional View calls in order to tell Oracle Infinity that the user is viewing a new page.

You can trigger Click/Event Calls as per normal in order tell Oracle Infinity that the user has performed any actions you wish to capture (for example, added an item to their basket).

How do I work with E-Commerce Data?

See CX Tag Quick Start : Firing E-Commerce data with the CX Tag.

Learn more

Advanced Tracking - Learn advanced tracking methods for the Infinity Module such as ORA.collect() and Mutations.