Google Tag Manager Fires Tags In Preview (Debug) Mode, But Not On The Live Site
I have added a custom HTML class to the div and innermost span (the text) of a button.
When this button is clicked in the preview (debug) mode, the event fires, and the real-time Google Analytics stats update accordingly.
When I click the same button outside of preview mode, it does not reflect on Google Analytics.
I have tried multiple browsers (Chrome, Chrome Incognito, Opera, Edge) (without any browser extensions) and a different computer and network, but none trigger the tag.
The class is on the live site outside of the preview mode.
Any help will be greatly appreciated - thanks in advance!
Answer
You're supposed to publish your workspace for it to work without preview.
Also, it's not good to use Click Classes. It's better to use Click Element -> Matches CSS Selector -> .calendy-consult-edwards, .calendy-consult-edwards *
Also, having pure JS in onclicks is not a good practice. Mixing languages leads to confusion.
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