BookmarkSubscribeRSS Feed

Use Google Tag Manager to send events using the SAS Customer Intelligence 360 JavaScript API

Started ‎08-21-2019 by
Modified ‎08-21-2019 by
Views 3,763

Symptoms

As websites get increasingly complex, there are more situations where the SAS Customer Intelligence 360 tag isn't able to automatically collect user behavior on your website. Website-specific event handlers might terminate a click event or shopping carts might be developed using Single Page Application technologies.

 

In these cases, the JavaScript API for SAS Customer Intelligence 360 allows users to collect all the required information. For many marketers, using the JavaScript API means involving their web development team, which could lead to longer turnaround times and change requests that compete with other site improvements.

Diagnosis

Marketers can use a tag manager to collect event information using the JavaScript API, without involving web developers. 

Solution

You can use Google Tag Manager (GTM) to call the SAS Customer Intelligence 360 JavaScript API for event collection. Google uses the concept of triggers and events/tags.   

 

First you need to define a trigger. See https://support.google.com/tagmanager/topic/7679108 for a list of triggers that are supported by GTM.

 

Then you define the event/tag or action that has to take place. For SAS Customer Intelligence 360, that action is the injection of a custom HTML tag that contains the JavaScript API call. When constructing this call, you have access to the trigger variables and the data layer variables.

 

In the following example, we are sending a SAS Customer Intelligence 360 click event when the visitor scrolls to 25%, 50%, 75%, or 100% of a website.  

 

First, define the scroll depth as the trigger.

 

Define a trigger in Google Tag Manager.Define a trigger in Google Tag Manager.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Next, define a custom HTML tag to fire when this trigger is met.

 

<script type="text/javascript"> 
com_sas_ci_acs.ap.i("event","send",
{
"event": "click",
"data-eventtype": "scroll",
"data-depth": "{{Scroll Depth Threshold}}"
}
);
</script>

Note: The {{Scroll Depth Threshold}} is a GTM variable. When you write your code, type {{ to see a list of all the variables that you have defined in GTM.

 

Define a custom HTML tag to fire when this trigger fires.Define a custom HTML tag to fire when this trigger fires.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After this configuration, you will see the following event being sent from the browser when the visitor scrolls to 25% of the page.

 

ClickEvent.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

output_3_cropped.jpg

 

 

 

 

 

 

 

 

 

Now you can define a goal or custom attribute based on this click event the same way you would define them based on automatically captured clicks.

 

For a full set of possible events that can be sent using SAS Customer Intelligence 360 JavaScript API, please check out the section Using the JavaScript Events API in the documentation.

 

#CI360

 

Version history
Last update:
‎08-21-2019 03:46 PM
Updated by:

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags