Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined properties of data element for web-vitals #10

Closed
PH1NO opened this issue Jan 10, 2023 · 5 comments
Closed

undefined properties of data element for web-vitals #10

PH1NO opened this issue Jan 10, 2023 · 5 comments

Comments

@PH1NO
Copy link

PH1NO commented Jan 10, 2023

I've installed the Web Vitals extension to Adobe Experience Platform via the Extensions. I've created the data elements that are preset after installing Web Vitals. When I try to use the console log for metrics, I receive "undefined" for all and when I try to grab the data element via _satellite, i get the following:

_satellite.getVar('Web-Vitals_Delta', event)
VM9:106 🚀 Failed to execute data element module web-vitals-js/src/lib/dataElements/metricDelta.js for data element Web-Vitals_Delta. Cannot read properties of undefined (reading 'webvitals')
TypeError: Cannot read properties of undefined (reading 'webvitals')

Browsers used:

  • Google Chrome - Version 108.0.5359.99 (Official Build) (64-bit)
  • Microsoft Edge - Version 108.0.1462.46 (Official build) (64-bit)

image

@yuhui
Copy link
Owner

yuhui commented Jan 10, 2023

@PH1NO The Data Elements have to be used in a Rule that has one of the Events from my Extension. For example, if you have a Rule that is triggered with the "Cumulative Layout Shift (CLS)" Event, then in that Rule's Conditions and/or Actions, you can use the Data Elements from my Extension. Then you'll be able to get the expected values.

So my question is: in your Rule(s) where you are using these Web Vitals Data Elements, which Event(s) are you triggering with?

@PH1NO
Copy link
Author

PH1NO commented Jan 10, 2023

Hi @yuhui , thank you for your reply. So I missed the step of adding those events to the rule, I've done a separate rule on it's own to fire when any of those Web Vitals events occur and I've tried it on a page load rule. When I try to send those data elements through the actions (via set variables) or in custom code, I don't see any results.

Here is my set up for the rule
image

Here is the data element set up (just selected my Attribution data element for this example)
image

Here is the error I get for the Attribution one:
image

When i tried console logging it, that threw an error as well stating that the web-vitals cannot grab any data due to it being undefined.

Unless I'm implementing incorrectly? But I tried going through the step by step process I've seen with your extension.

Thanks so much for your assistance

@yuhui
Copy link
Owner

yuhui commented Jan 11, 2023 via email

@PH1NO
Copy link
Author

PH1NO commented Jan 11, 2023

Will do. Thank you!

@PH1NO
Copy link
Author

PH1NO commented Jan 11, 2023

Thank you @yuhui for your assistance!

@PH1NO PH1NO closed this as completed Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants