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.

[gatsby-plugin-google-analytics] Pass event category, label, and action to the <OutboundLink> component

See original GitHub issue

Summary

Be able to pass event category, label, and action as properties to the <OutboundLink/> component provided by gatsby-plugin-google-analytics

Basic example

<OutboundLink href="mailto:careers@site.com"
    eventCategory="careers"
    eventAction="apply"
    eventLabel="office_assistance">
  <Button>Apply now</Button>
</OutboundLink>

Motivation

It would be great if we can have some control over the category, action, and label of each event so that we can make Event flows based on some of those event properties.
I would be happy to contribute if you guys think that this addition would make sense.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
freiksenetcommented, Jan 8, 2020

Thank you for the issue!

That would be a great feature indeed! Would you like to make a PR to fix that? You would need to change OutboundLink component to take category/action/label from the props.

Thank you! 💜

0reactions
KristinaKoevacommented, Jan 29, 2020

Fixed by #20570

Read more comments on GitHub >

github_iconTop Results From Across the Web

gatsby-plugin-google-analytics - npm
To make it easy to track clicks on outbound links in Google Analytics, the plugin provides a component. To use it, simply import...
Read more >
Gatsbyjs + Google analytics - tracking custom events?
gatsby-plugin-google-analytics inserts GA into the end of the body of your site automatically, so basic pageviews are easily tracked that way.
Read more >
How to set up event tracking in Google Analytics
Each event is made up of four components that you define. These are category, action, label, and value. Category. A category is an...
Read more >
[UA→GA4] Send events to both your UA and GA4 properties
Event action becomes an event name in the Google Analytics 4 property. Event category, label, and value become event parameters in the Google...
Read more >
react-ga - npm.io
When included as a script tag, a variable ReactGA is exposed in the ... ReactGA.event({ category: 'Editing', action: 'Deleted Component', label: 'Game ...
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