Ad
Seeing Custom Tag Manager Keys In Google Analytics?
This youtube demo inclues a page_path
event key. I tried including the same thing in this stackblitz demo:
uaClick1() {
console.log("CLICKED UA 1")
gtag('event', 'MY_BUTTON_1_CLICK', {
'page_path': "in",
'event_category': 'BUTTON_CLICK',
'event_label': 'UA Click 1',
'value': 'Some custom value 1' })
}
However I don't see the custom key showing up in Google Analytics:
Is it possible to add custom keys as shown? Also IIUC the value
key is standard, but I don't see that either. Is there some other place I should be looking?
Ad
Answer
no, you can't pass custom data in that way. first, you'll need to set up custom dimension/metrics and then use specific mappings as shown in the docs:
gtag('config', 'GA_MEASUREMENT_ID', {
'custom_map': {'dimension1': 'event_label'}
});
//...
gtag('event', 'MY_BUTTON_1_CLICK', {
'page_path': "in",
'event_category': 'BUTTON_CLICK',
'event_label': 'UA Click 1',
'value': 334 }) // has to be numerical value
Ad
source: stackoverflow.com
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
Ad