Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Update to use of autotrack #40

Closed
pke opened this issue Mar 7, 2016 · 5 comments
Closed

Update to use of autotrack #40

pke opened this issue Mar 7, 2016 · 5 comments

Comments

@pke
Copy link

pke commented Mar 7, 2016

Google released the Autotrack node module https://github.com/googleanalytics/autotrack
Are there any plans to upgrade this react-ga to the Autotrack module?

@yangshun
Copy link
Contributor

Hey @pke , react-ga already has support for plugins. Install the autotrack plugin separately and load the plugin via ga.plugin.require('autotrack').

More documentation can be found here: https://github.com/react-ga/react-ga#gapluginrequirename

@pke
Copy link
Author

pke commented Mar 30, 2016

Ah cool. Ok. I rolled out my own solution for now using the GA Universal API. It works except for the event reporting. So maybe I'll give react-ga another try later.

@adrianhorning
Copy link

I'm having trouble getting the maxScrollTracker to work.
I npm installed autotrack, then put ReactGA.plugin.require('autotrack'); and ReactGA.plugin.execute('autotrack', 'maxScrollTracker'); in the page I wanted to track. What am I missing?

@LazerJesus
Copy link

@adrianhorning +1

@LazerJesus
Copy link

LazerJesus commented Aug 26, 2020

   1import React, { FC } from 'react';
   2
   3import ReactGA from 'react-ga';
   4import 'autotrack';
   7
   8export const AnalyticsProvider: FC = ({ children }) => {
  11  ReactGA.initialize(process.env.GA_ID, {
  12    debug: true,
  13    gaOptions: { userId: user.id },
  14  });
  17
  18  ReactGA.plugin.require('autotrack');
  21
  22  return <>{children}</>;
  23};

this does not enable autotrack. why?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants