Skip to content

device wise metrics #683

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

barshat7
Copy link
Contributor

@barshat7 barshat7 commented Apr 9, 2025

forms: device wise segregation in metrics

Please ensure your pull request adheres to the following guidelines:

  • make sure to link the related issues in this description
  • when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes

Related Issues

Thanks for contributing!

forms: device wise segregation in metrics
@@ -54,7 +55,13 @@ function aggregateFormVitalsByDevice(formVitalsCollection) {
totals.formengagement = calculateSums(formengagement, totals.formengagement);
totals.pageview = calculateSums(pageview, totals.pageview);
totals.formsubmit = calculateSums(formsubmit, totals.formsubmit);

// Traffic Acquisition is not aggregated by device type
totals.trafficacquisition = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totals.trafficacquisition = { ...trafficacquisition }

formEngagement,
formSubmit,
pageViews: {
total: pageViews,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to simplify it to:

urls.push({
        url,
        ...metrics
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can cleanup all the existing code then

let formViews = metrics.formview.total;
let mobileFormViews = metrics.formview.mobile;
let desktopFormViews = metrics.formview.desktop;
if (!formViews) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets skip the fallback now as we have improved RUM to capture formviews.

pageViews: deviceData.pageview.total,
formViews: deviceData.formview.total,
formEngagement: deviceData.formengagement.total,
pageViews: deviceData.pageview,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here too:

urls.push({
        url,
        ...metrics
});

Copy link
Contributor

@nit23uec nit23uec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline comments.

// Default to pageViews if formViews are not available
const formViews = metrics.formview.total || pageViews;
let formViews = metrics.formview.total;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check if formViews = 0
hasLowerConversionRate this will do division by 0

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

Successfully merging this pull request may close these issues.

3 participants