Expand my Community achievements bar.

SOLVED

I was trying to convert my custome code rule data collection to AEP web SDK. how to replace the _satellite.track() call in AEP web SDK

Avatar

Level 3

var iframe = document.querySelector('iframe[src*="vimeo"]');
var player = new Vimeo.Player(iframe);
var cent, counter25 = 1, counter75 = 1, retVal, flag = 0;
var isVideoEnded = false;

player.on('timeupdate', function(data) {
cent = data.percent * 100;
isVideoEnded = false;

if (0.04 <= data.seconds && data.seconds <= 0.90 && flag === 0) {
flag = 1;
_satellite.track("video_start");
}

if (Math.floor(cent) === 25 && counter25 === 1) {
_satellite.track("video_25");
counter25++;
retVal = true;
}

if (Math.floor(cent) === 50 && counter25 === 2) {
_satellite.track("video_50");
counter25++;
}

if (Math.floor(cent) === 75 && counter75 === 1) {
_satellite.track("video_75");
counter75++;
}

if (data.seconds === data.duration) {
_satellite.track("video_end");
counter25 = 1;
counter75 = 1;
isVideoEnded = true;
}
});

player.on('pause', function(data) {
if (!isVideoEnded) {
_satellite.track("video_pause");
}
});
I am using this code in my window loaded code. Now I am trying t convert this code in AEP web SDK. 
I was stuck, what to replace the _satellite.track() call in AEP Web SDK.

can anyone help me this.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

Maybe I am missing something, but _satellite.track() calls the Rule that actually creates the tracking call... why can't you just change those rules that you are calling to use WebSDK instead of AppMeasurement?

 

WebSDK rules still need triggers to know when to run... and _satellite.track() is the trigger.... 

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor and Adobe Champion

Maybe I am missing something, but _satellite.track() calls the Rule that actually creates the tracking call... why can't you just change those rules that you are calling to use WebSDK instead of AppMeasurement?

 

WebSDK rules still need triggers to know when to run... and _satellite.track() is the trigger.... 

Avatar

Community Advisor

You're right, _satellite.track() is just used to manually trigger a rule by name. It doesn’t care whether the rule sends data via AppMeasurement or the Web SDK. So if you're already using_satellite.track("video_25"), and that rule fires a Beacon with AppMeasurement, you just need to update the action part of the rule to use the AEP Web SDK instead.

No need to replace_satellite.track() in your Vimeo code. Keep using it as the trigger, just ensure the corresponding rule in Launch is set to use "Send Event" with Web SDK instead of the legacy Adobe Analytics action.

So basically:

  • Keep_satellite.track("video_start") and others in your code.

  • Go into Launch --> find the rules with those event names.

  • Update the actions to use "Send Event" with AEP Web SDK.

That should do it, let me know if that helps!

Avatar

Level 3

I will be trying this approach

Avatar

Level 3

I have tried your solution. It was working for all video event. But not sure how to pass the evar through the custom code. In custom code am using s.eVar2="value". how to convert this in webSDK?

Avatar

Community Advisor and Adobe Champion

Ah.. seeing values directly... Since I am not on WebSDK, I don't have that code immediately handy, but I believe you can set value into the Data Stream schema?

 

This may take some trial and error.. but maybe referencing the xdm object in your custom code:

 

xdm.xxx.xxxx.xxxx = "value";

 

You will have to figure out the path where your eVar data is being populated...

 

If you are using the analytics model within the data stream, you might need to reference:

 

data.__adobe.analytics.eVar2 = "value";