Event Tracking not Appearing In Analytics - google-analytics

I am trying to use Google Event Tracking to record when a certain user action is taken. I have a JS method called runGABanner that fires the Google Analytics code when conditions are met, but I'm not seeing anything update in GA Admin page.
In my code, I set up the GA code as such:
const runGABanner = () =>{
ga('send', {
hitType: 'event',
eventCategory: 'AdBlocker',
eventAction: 'Ad Blocker Displayed',
eventLabel: 'Ad Blocker'
});
}
I was expecting to see "Banner Displayed" under "Event Action", but as the screenshot shows, nothing is appearing there.
Any thoughts as to why this is happening?

Related

Google Analytics Events are Not Registering

I am in need of assistance. I am trying to implement Custom Event Tracking for a form submission as both an Analytics Goal, and a Conversion Goal for Google Optimize.
Here is a screenshot of the Google Analytics Goal:
I have my Google Analytics in the head (with sensitive information redacted with XXXXX) as such:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=XXXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'XXXXXXXXXXX', { 'optimize_id': 'XXXXXXXXXXX'});
</script>
And then I have tried to fire the custom event with both:
ga('send', {
hitType: 'event',
eventCategory: 'mailchimp',
eventAction: 'subscribe',
eventLabel: 'soft-lead-form'
});
and also:
gtag('event', 'play', {
'event_category': 'mailchimp',
'event_label': 'soft-lead-form'
});
I have confirmed that analytics is instanced effectively by writing to the console with:
if (gtag) {
console.log("ga present");
}
And I have confirmed that the user action triggers the ga call by writing to the console in the same function with:
$("#mc-embedded-subscribe-form").submit(function(){
gtag('event', 'play', {
'event_category': 'mailchimp',
'event_label': 'soft-lead-form'
});
console.log("ga Event Submitted");
});
I would GREATLY APPRECIATE any help. I've been through pages of documentation and, despite trying/testing multiple points in this process, I can not get the event to appear in Either Analytics or Optimize. This is a crucial piece for our marketing efforts and I very much want to make it work.
Thank you so much!
Gary
Surely the event with ga(...) you have to remove it because you are using gtag.
If you are seeing the events real time, then you need to wait for at least 24-72 hrs to get the data updated under Behaviour -> Events -> Overview.

Google Analytics Event tracking for Goals

I am having an issue in using the Google Goals for my My Event Tracking. I have added Google even tracking code to my web page. However, I cannot check for any conversions in my Google Goals but the event result can be shown in the Google Analytic --> Behavior --> Events Overview.
My Code is below
` <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-87810245-1', 'auto');
ga('send', 'pageview');
</script>
<script>
$('#contact-form').on('submit', function(event) {
// Prevent the browser's default form submission action.
event.preventDefault();
ga('send', 'event', {
eventCategory: 'Contact',
eventAction: 'Information Request',
eventLabel: 'Contact Form',
hitCallback: function() {
$('contact-form').trigger('submit');
}
});
});
</script>`
Code for my Submit Button:
<input type="submit" id="submit" value="Validate and Submit" onclick="ga('send', 'event', 'form', 'submit', 'order sent', 10);"/>
My Google Goals:
enter image description here
Google Analytics Events Overview:
So you've got two events going on, one for the click of the submit button (to track intent perhaps) and one for the form submission itself. Your goal is configured to expect a value Greater than 10, but your form submission event is not passing a value in. You should either add a value (greater than 10), or remove the value from the goal configuration. Also your screenshot shows likely just the click event (since there's a value of 10 associated with it), but you'd probably be more interested in the actual submissions themselves.

Event tracking using Google Analysis

I'm adding a code on the Complete instance of a video played using jwplayer for analysis using google analytics event tracking. There I need to overwrite the base URL that is sent in the analysis code. Could you please help me with the exact parameter that I need to send for that. Below is the code I'm using to send the request to Google Analytics:
ga('send', 'event', 'Vedio', 'play', 'vedio_name');
Use a configuration object to set the parameters and include the page parameter with a page path as value:
ga('send', {
hitType: 'event',
eventCategory: 'Videos',
eventAction: 'play',
eventLabel: 'Fall Campaign',
page: '/my/custom/pagepath/'
});

Google Analytics event tracking -Contact Form Submit

I am trying to track when a user clicks on the submit form button and they send contact information. I have this code on the contact page:
<input type="submit" value="Send" class="btn big btn_submit_form" onClick="ga('send', 'event', { eventCategory: 'Contact', eventAction: 'Information Request', eventLabel: 'Contact Form'});">
I am using Universal Analytics.
In my Google Analytics account, I have the goal description Name as Contact Form Submit, and the Goal Type is Event. The event conditions are as follows:
Category -Equals to- Contact
Action -Equals to- Information Request
Label -Equals to- Contact Form
with the Value field being left empty.
I have "Use the Event value as the Goal value for the conversion" set to yes.
However, Google Analytics doesn't seem to be tracking the event. Any idea how to fix this?
Thanks.
The most likely problem here is that your page is being unloaded before the event hit has time to send. When you submit a form on a web page, most browsers will stop executing JavaScript and start loading whatever new page the form's action attribute is pointing to.
The general workaround for this is to call preventDefault on the form's submit event, wait for the hit to successfully send to Google Analytics, and then manually re-trigger the form submit.
Here's how that might look (note: I'm using jQuery for simplicity):
$('#my-form').on('submit', function(event) {
// Prevent the browser's default form submission action.
event.preventDefault();
ga('send', 'event', {
eventCategory: 'Contact',
eventAction: 'Information Request',
eventLabel: 'Contact Form',
hitCallback: function() {
$('my-form').trigger('submit');
}
});
});
The key part in the above code is the hitCallback function, which gets invoked when GA returns success from the event hit beacon.
Maybe try changing the event to the form submit, instead of the button click:
<form onSubmit="ga('send', 'event', { eventCategory: 'Contact', eventAction: 'Information Request', eventLabel: 'Contact Form'});">
The form can be submitted in ways other than the clicking the submit button (for instance pressing enter in an input field)
Also, in my experience, the tracking will post correctly almost every time, even when you do not call preventDefault on the event.

Where find events tracker in google analytics?

I have track event like this.
$('.payment_button').on('click', function() {
var _this = this;
ga('send', 'event', 'Payment', 'Payment', 'Payment Checkout', {
'hitCallback': function() {
$(_this).parents('form').first().submit();
}
});
It's worked good, but I don't know where to view results. In google analitics admin I can view my event only in real time events, but after 30 minuts it's removes and I can't view it.
UPDATE: Google Analytics generally updates reports every 24 hour
On the left side of the reports page where the Report Navigation menus is, it's under
Behavior > Events

Resources