Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

In Page view call need to add additional events (page load time, time spent on previous page) from data-layer

Avatar

Level 2

Hi,

 

I am new with the web-sdk implementation, need help with one specific scenario.

 

In page view call i want to append additional events like page-load time, time-spent on previous page (developer have passed the values in datalayer). Like this - web.webPageDetails.pageLoadTime and web.webPageDetails.timeSpentOnPreviousPage.

Parth_Gupta_1-1716321464837.png

 

Created the corresponding data elements and using those data-elements in XDM object. By assigning in _experience.analytics.events1to100.event31.value to corresponding data-element. Is that approach right ? Because i am not seeing any data getting populated into reports.

 

While i can see data flowing in interact call. 

Parth_Gupta_0-1716321341532.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Parth_Gupta 

in your data element, you are trying to assign an object to the actual value of the event.

 

looking at your data layer screenshot, you are also having a value property in there. 

 

try this instead 

 

web.webPageDetails.pageLoadTime.value

 

IMG_6891.jpeg

IMG_6892.jpeg

 

you should be able to verify this by executing this in your console 

 

adobeDataLayer.getState("web.webPageDetails.pageLoadTime")

 

respectively

 

adobeDataLayer.getState("web.webPageDetails.pageLoadTime.value")


hope that helps.

 

Björn

Cheers from Switzerland!


View solution in original post

8 Replies

Avatar

Community Advisor

Hi @Parth_Gupta 

your approach should be correct. Can you shed a little light on when and where you set custom events? I.e., through custom code or mapping directly in the WebSDK actions?

 

Have you tried setting a dummy event to value 1 where you set the page relevant data in the XDM? Does that show?


cheers

Björn

Cheers from Switzerland!


Avatar

Level 2

Hi Bjorn,

 

Yes i tried sending dummy values as well - like random numbers. That data is coming up in the reports.

 

Page Load time data element -

Parth_Gupta_2-1716358462116.png

 

XDM is set up like this -

Parth_Gupta_3-1716358562637.png

 

 

My Rule is like this -

Parth_Gupta_1-1716358405710.png

 

Thanks,

Parth

 

 

Avatar

Community Advisor

Hey @Parth_Gupta 

 

Are the events enabled in the reporting suite to collect data ?

 

Cheers,

Abhinav

Avatar

Level 2

Hi Abhinav,

 

That is the first step that i always do. It is enabled.

Avatar

Community Advisor

That's good then @Parth_Gupta 

At times, these small things cause issues.

 

Can you also look at the type of event. Is it counter or numeric ?

 

Cheers,

Abhinav

Avatar

Community Advisor

Agree with @abhinavbalooni ,

all is typed, so if your data element returns a "1" instead of a 1, this will cause issues. Even though I am not sure whether WebSDK does some preprocessing and dumps those values since to my understanding the call would rather not be processed yet still go out.

Cheers from Switzerland!


Avatar

Correct answer by
Community Advisor

Hi @Parth_Gupta 

in your data element, you are trying to assign an object to the actual value of the event.

 

looking at your data layer screenshot, you are also having a value property in there. 

 

try this instead 

 

web.webPageDetails.pageLoadTime.value

 

IMG_6891.jpeg

IMG_6892.jpeg

 

you should be able to verify this by executing this in your console 

 

adobeDataLayer.getState("web.webPageDetails.pageLoadTime")

 

respectively

 

adobeDataLayer.getState("web.webPageDetails.pageLoadTime.value")


hope that helps.

 

Björn

Cheers from Switzerland!


Avatar

Level 2

Ahh such a small mistake. Thanks Bjoern. It worked