question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transferring field attribution to UA

See original GitHub issue

First of all, I want to thank you for an incredibly cool tool!

We are trying to deal with the transfer of attribution of fields to the UA from Google.

Step by step:

  1. We have connected the library and added a function:
import {onCLS, onFID, onLCP} from 'https://unpkg.com/web-vitals@3/dist/web-vitals.attribution.js?module';
function sendToGoogleAnalytics({name, delta, value, id, attribution}) {...}

  1. and enabled field attribution:
  switch (name) {
    case 'CLS':
      eventParams.debug_target = attribution.largestShiftTarget;
      break;
    case 'FID':
      eventParams.debug_target = attribution.eventTarget;
      break;
    case 'LCP':
      eventParams.debug_target = attribution.element;
      break;
  }
    case 'FID':
      eventParams.debug_target = attribution.eventTarget;
      break;
    case 'LCP':
      eventParams.debug_target = attribution.element;
      break;
  }
  1. Passing the results to GA
onCLS(sendToGoogleAnalytics);
onFID(sendToGoogleAnalytics);
onLCP(sendToGoogleAnalytics);

But we do not get the result in the form of fields (div and so on) that led to the greatest changes in CLS, FND, LCP.

Tell me, please, what else do we need to do?

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
voxtermencommented, Nov 15, 2022

Many thanks to you, Barry! It works!

0reactions
voxtermencommented, Nov 16, 2022

Once again and many many many times, thank you very much, Barry!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[UA→GA4] Goals migration tool - Analytics Help
The goals migration tool allows you to quickly recreate eligible goals from your connected Universal Analytics property as conversion events in your Google ......
Read more >
Before you begin a GA4 ecommerce migration (gtag.js)
This document provides an overview of the options available to migrate your Universal Analytics (UA) ecommerce implementation to a ...
Read more >
GA4 Problems - 4 Challenges With Google Analytics 4
Hi there,. Data from UA will not automatically be transferred to GA4. The data models for the two properties are different. In UA,...
Read more >
Tutorial 9. Attribute Transfer Node - YouTube
This tutorial looks at the practical applications of the Attribute Transfer Node which passes information from one object to another based ...
Read more >
Patient Attribution - Connecticut State Office of Health Strategy
But there are instances in which a patient decides to seek care from another provider that are reasonable and do not present a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found