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.
Marketers can use a tag manager to collect event information using the JavaScript API, without involving web developers.
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.
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.
After this configuration, you will see the following event being sent from the browser when the visitor scrolls to 25% of the page.
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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.