In Page view call need to add additional events (page load time, time spent on previous page) from data-layer | Community
Skip to main content
Level 2
May 21, 2024
Solved

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

  • May 21, 2024
  • 1 reply
  • 2378 views

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.

 

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. 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by bjoern__koth

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

 

 

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

1 reply

bjoern__koth
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 22, 2024

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!
Level 2
May 22, 2024

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 -

 

XDM is set up like this -

 

 

My Rule is like this -

 

Thanks,

Parth

 

 

abhinavbalooni
Community Advisor
Community Advisor
May 22, 2024

Hey @parth_gupta 

 

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

 

Cheers,

Abhinav