Configuring Acoustic Digital Analytics and Acoustic Exchange

As a part of Acoustic Exchange integration with your Single-Page Application (SPA) or Multi-Page Application (MPA), you must configure a tagging and analytics engine such as Acoustic Digital Analytics.

Prerequisites

  • You must have Acoustic Digital Analytics configured on your channel that is to be personalized. For detailed information about configuring Acoustic Digital Analytics for your channel, see this IBM Digital Analytics documentation.
  • You must have an Acoustic Digital Analytics ID for the channel to be personalized.
    Note:

    The DA ID must be numeric and should not contain any alphabets or special characters such as "|"

    For example: 30001001 is a valid DA ID, whereas 30001001|RTP is not valid.

Step 1: Get the Acoustic Exchange Capture Enablement Key

  1. In Acoustic Exchange, navigate to Acoustic Exchange Capture from the Tools menu.
  2. Click Enablement Key icon, and copy the two lines of code that contain the enablement key.

Step 2: Add the tracking code to your SPA or MPA

In case of Single-Page Application, add the following code at the beginning of HEAD tag of index.html page. In case of Multi-Page Application, add the following code at the beginning of HEAD tag of each HTML page. This code snippet enables Acoustic Digital Analytics to track the visitor behavior on your channel.
Note: If Acoustic Digital Analytics is already configured for your channel, the following code would already be present in your channel page and only needs to be updated as required. Add the code if it is not present in your channel pages.

<script>
         var channelID = "<<Channel Tenant ID>>";
         var DA_Id = "<<DA ID>>"; 
         var ubxEvents = [];		
         var identifiersMapperArray = [];   
</script>   
<script type="text/javascript" src="//commercelibs.ibm.com/common/ubxCapture.js"> </script>
<script> ubxCapture.setTenantID("WRTP","<<channel tenant ID>>");
               ubxCapture.setTenantID("DA","<<DA ID>>");
</script>
<script type="text/javascript"> ubxCapture.setID("<<UBX Capture Enablement Key>>"); 
</script>
<script>
//Start of Digital Analytics Tracking snippet
        cm_ATEnabled = true;
        _cmPartnerUtils.setContactRule({
            cid: DA_Id,
            version: 1,
            partners: [{
                pid: 9999,
                type: 'S',
                url: 'https://my2.digitalexperience.ibm.com/2fec40e4-091c-40ca-b1df-d45cf19144da/wrtp/prod/wrtp2da.js',
                surl: 'https://my2.digitalexperience.ibm.com/2fec40e4-091c-40ca-b1df-d45cf19144da/wrtp/prod/wrtp2da.js',
                key: 'WRTP'
            }],
            tags: [ 
                [1, 2, 3, 4, 5, 6, 7, 8]
            ],
            segmentRules: [],
            segments: [],
            usesNewRepeat: false
        });
</script>
Next, in case of Single-Page Application, add the following code in the BODY tag of index.html page. In case of Multi-Page Application, add the following code in the BODY tag of each HTML page.

<script>
ibm_ubx.registerCallback("WRTP", function (eventPayload) {
                if(eventPayload) {
                    ubxEvents.push(eventPayload);
                }
            }); 
</script>   

Step 3: Add the personalization code

Add the code snippet required to create personalization on your channel pages.