BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jingze0619
Obsidian | Level 7

To all who read this

 

We have been communicate with SAS team for the last 2 months about this, but they didn't solve our problem. So I post my question here, if you know answer please let me know. Very appreciate your help. 

 

Our Goal is to capture (1) Monetate ID, (2) Monetate Variant, and (3) Montate Campaign. 

 

Based on what SAS told us,

(1) we use the click event. [however, we are not sure whether use click event is right choice to capture it or not]

(2) follow the example SAS provide, this is the code our IT wrote  

 

var dataLayer = window.dataLayer = window.dataLayer || [];
for (var i = 0; i <campaigns.length; i++) {
com_sas_ci_acs.ap.i("event", "send", {
    "event": "click",
  "data-eventtype": "monetate",
  "data-monetate_campaign": campaigns[i].key,
  "data-monetate_variant": campaigns[i].split,
  "data-monetate_ID": campaigns[i].id
});
 
  console.log("monetate info sent to SAS");                                           
}

 

 

We first did goal configuration as follow: 

1.png

 

2.png

 

3.png

 

4.png

We did a test, but end didn't capture anything. 

 

 

Then we use 2nd method they recommend: click event for customer attributes 

5.png6.png7.png

However,we also end up didn't capture anything .

 

 

If you know the answer or have any recommendations, please reply this post. 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
OlafKratzsch
SAS Employee

To change this code using the v2 JS API and sending a custom event it would need to look like below. Still requires the campaigns array to be defined and have values, otherwiese no events are getting sent

 

var dataLayer = window.dataLayer = window.dataLayer || [];
for (var i = 0; i <campaigns.length; i++) {
ci360i("send", {
"eventName": "custom",

"apiEventKey": "MONETATEEVENT",
"monetate_campaign": campaigns[i].key,
"monetate_variant": campaigns[i].split,
"monetate_ID": campaigns[i].id
});

console.log("monetate info sent to SAS");
}

 

with a matching configuration in the UI under Events -> New -> Custom -> Javascript API

 

OlafKratzsch_0-1586307707623.png

 

OlafKratzsch_1-1586307931702.png

 

View solution in original post

17 REPLIES 17
OlafKratzsch
SAS Employee

With the release that was released today you could be using the v2 API and send what is now called 'custom events' directly.  Don't think that would solve the problem, it would make it just a bit simpler. Your configuration looks good.  My guess is that the API calls are never made.  Can you see the click events being sent to SAS in the network tab? Do you see the "monetate info sent to SAS" message in the console?

 

Looking at that JS snippet I am wondering if your campaigns array is defined and if any API calls are even made.

 

 

jingze0619
Obsidian | Level 7

Hi. OlafKratzsch. Thank you for the answer.

 

Could you explain what you mean here? I am not sure where to find those information. 

 

"Can you see the click events being sent to SAS in the network tab? Do you see the "monetate info sent to SAS" message in the console?" 

 

Thanks 

Jingze 

OlafKratzsch
SAS Employee

CI360 events are sent via POST to the SAS ingest server. When you open the developer tools of your browser (F12 on Windows and Option-Command I on Mac) and go to the 'network' tab you can see what is sent. Just filter for the XHR requests and then select the post request. Usually the domain contains CI360, but it could be different based on the CNAME you have set up.

 

Attached example is from Firefox. Before you click you need to also check the "persist Logs" option as the click might be recorded on the previous page. When you select these POST requests that go to SAS you can check the details. On Firefox the payload is found under "Params". On Chrome it's under Headers (scroll to the Form Data section).  The 'event' attribute tells you if it is a page load, click, etc.  When your API calls work you should be able to see a POST request to SAS with the event "click" and your custom data- values.  If you can't see this event then it is never sent and the API call never made.

Your JS code that makes the API call contains the line

console.log("monetate info sent to SAS")

So every time an API call to SAS is made you should see the message 'monetate info sent to SAS' in your browser's console. The 'console' is another tab in your browser's developer tools. Probably easier to check that message that looking for the events. If that message isn't printed to the console it means the API call isn't made to the SAS tag and no information sent.

 

Hope that helps.

OlafKratzsch
SAS Employee

Forgot to attache the screenshot I was talking about 🙂

 

Screen Shot 2020-03-25 at 5.05.22 PM.png

 

jingze0619
Obsidian | Level 7
Thanks. OlafKratzsch

So, if we can't see this event then it is never sent and the API call never made, does that mean 'event: click' is the wrong type here?
OlafKratzsch
SAS Employee
No. it has nothing to do with the event type. Your JS logic is simply wrong. Either the code is never executed or the for loop never executes as campaigns.length is 0 or undefined.
Do you have an URL where these values are set and I could take a look?
jingze0619
Obsidian | Level 7
I think the code were executed, we did 4 test, our IT saw it successfully, so I configure it in SAS, but it seems SAS didn't capture it.

The reason we were to told to build JS event API is because those monetate informations are not in the fixed datalayer. The Monetate is a test 50%-50% (A-B testing), customers are random choose to view the same page (for example: homepage), but 50% of them have the monetate information, and 50% didn't.

The reason we are thinking click event is not correct event based on SAS documents: Click events track when someone clicks an element on the page. Click events are not sent unless a load event has already been triggered.

I will asked our IT, if he can provide more information to you tomorrow. Sorry, I am not a tech person.
jingze0619
Obsidian | Level 7
Hi. OlafKratzsch

Yes. I followed with our IT. But since we are no longer use V1 version. He said those script is no longer on the website, so we can not provide you the URL for now. We will have to redo everything for V2 version, such as the event script for V2 and test again.

I will let you know if we still have same problem as before. But thank you for all the information you provided. It's really helpful.

Thanks
Jingze
jingze0619
Obsidian | Level 7
Hi. OlafFratzsch.

This is Jingze again. After the update, both goal configuration and customers attributes are removed. So we plan to try use the custom events you mentioned. Just wonder if there is an example (such as screen shots of how to configure the 'custom events')

Thanks
Jingze
OlafKratzsch
SAS Employee

Hi Jingze,

in the UI you just need to declare the custom event with all the planned custom attributes as described here:  https://go.documentation.sas.com/?cdcId=cintcdc&cdcVersion=production.a&docsetId=cintug&docsetTarget...

 

The API call you need to put into your site is described here:  https://go.documentation.sas.com/?cdcId=cintcdc&cdcVersion=production.a&docsetId=cintag&docsetTarget... (we just updated this part to clarify the use of the ApiEventKey which was missing in a previous version)

jingze0619
Obsidian | Level 7
Good morning OlafKratzsch

So about the new code our IT wrote below, we need to add the apiEventKey for 360 Discover user as well, right? Because we follow the click event, it didn't have this required apiEventKey.

var dataLayer = window.dataLayer = window.dataLayer || [];
for (var i = 0; i <campaigns.length; i++) {
com_sas_ci_acs.ap.i("event", "send", {
"event": "click",
"data-eventtype": "monetate",
"data-monetate_campaign": campaigns[i].key,
"data-monetate_variant": campaigns[i].split,
"data-monetate_ID": campaigns[i].id
});

console.log("monetate info sent to SAS");
}


Thank you so much.
Jingze
OlafKratzsch
SAS Employee

To change this code using the v2 JS API and sending a custom event it would need to look like below. Still requires the campaigns array to be defined and have values, otherwiese no events are getting sent

 

var dataLayer = window.dataLayer = window.dataLayer || [];
for (var i = 0; i <campaigns.length; i++) {
ci360i("send", {
"eventName": "custom",

"apiEventKey": "MONETATEEVENT",
"monetate_campaign": campaigns[i].key,
"monetate_variant": campaigns[i].split,
"monetate_ID": campaigns[i].id
});

console.log("monetate info sent to SAS");
}

 

with a matching configuration in the UI under Events -> New -> Custom -> Javascript API

 

OlafKratzsch_0-1586307707623.png

 

OlafKratzsch_1-1586307931702.png

 

jingze0619
Obsidian | Level 7
Hi. OlafKratzsch

I will probably update tomorrow afternoon if we successful track monetate info.

Thanks so much.
Jingze
How to improve email deliverability

SAS' Peter Ansbacher shows you how to use the dashboard in SAS Customer Intelligence 360 for better results.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 17 replies
  • 2563 views
  • 10 likes
  • 2 in conversation