react-gtm icon indicating copy to clipboard operation
react-gtm copied to clipboard

Proper way to push Behavioural data to Google Analytics (Page Path, Page Title)

Open LockeAG opened this issue 3 years ago • 1 comments

We are having a very simple issue related with getting the paths and titles for google analytics.

we are trying so far :

const tagManagerArgs = {
  gtmId: 'GTM-NQW7XVF',
  dataLayer: {
    event: 'Pageview',
    pagePath: location.pathname,
    pageTitle: document.title,
  }
}

and is not pushing anything to analytics :(

LockeAG avatar Nov 04 '21 11:11 LockeAG

Did you use TagManager.dataLayer(tagManagerArgs) to push it?

trungthecelestial avatar Feb 20 '22 14:02 trungthecelestial