I'm using google analytics and am using this code as an example to capture a click event.
ga('send', {
'hitType': 'event', // Required.
'eventCategory': 'button', // Required.
'eventAction': 'click', // Required.
'eventLabel': 'nav buttons',
'eventValue': 4
});
where do I find this data in the reporting?
what I am able to find is event catgory buton but I cant find where this button was clicked with eventValue 4.
Can you please help.
I'm pretty sure that you misunderstand what "event value" means - this is to monetize non-ecommerce events. Which means event value is a metric, which in turn means that the values for multiple events will be added up.
So, the only case where you could possibly see the value "4" is when you isolate one single event. Else you will see a total (or average) for all events with the selected category/action/label (depending on the report).
Related
I am trying to track user feedback onclick of thumpsUp(1) or thumsDown(0) : with help of GA but not able to track the events in the Analytics Dashboard as shown below.
window.ga("send", {
hitType: "event",
eventCategory: "button",
eventAction: "feedback",
eventLabel: pageID, // page url
eventValue: value, // 1 or 0
});
}
custom event is not appearing below:
I am able to get events :
Is it possible to map vote and pageID together so that we can know which page has which vote
Many Thanks
The code shown is for Universal Analytics but dashboard is on GA4.
They are 2 different things.
You can find code to setup GA4 events in the documentation: https://developers.google.com/analytics/devguides/collection/ga4/events?client_type=gtag
To understand who clicked on up/downvote you can use the parameters associated with the event:
https://developers.google.com/analytics/devguides/collection/ga4/event-parameters?client_type=gtag
Note: the data in the GA4 platform (unlike UA) are visible after 24h.
I'm trying to track clicks on the page. I have added GA script to my page and I can see the traffic. The next step is to track click on given button. I have added following script to my buttons:
onclick=gtag('event', 'Click g-store top', {
'event_category' : 'ButtonClick',
'event_label' : 'Click to google play'
});
I can see the events flowing to my dashboard under "Realtime" label as events in last 30min.
But I can't see them in more persistent way under Engagement -> Events. What am I missing ?
As stated by Michele Pasani, you need to wait at least 12-24h until the events show up in the "All events" page
I have a R Shiny app that I have connected to Google Analytics using Google Tag Manager (R Shiny app means AJAX website). I am currently tracking the standard stuff like PageViews, and have set up a tag to track which Tab a user clicks on (Using Click Element).
In most tabs, I have a drop-down menu/list (can be seen in the picture). When clicking on this list to select/change the input, the click element does not fire. So clicking does not work here.
In the same picture, I have included the source html code. I highlighted what I think is important. The default input is "Age Group (Discrete)." The "option value=" and "selected" changes the input (changed to "Pyramid (Discrete)"). And it also changes in the div class="item" data-value=..." line.
I do not know how to capture when a user changes the input using Google Tag Manager. I am however able to successfully track this if I put this GA code in my JavaScript file.
$(document).on('change', 'select', function(e) {
ga('send', 'event', 'widget', 'select data', $(e.currentTarget).val());
});
But the above only works if I also have this included:
ga('create', 'UA-######', 'auto');
ga('send', 'pageview');
Which means it is double-counting pageviews (tracking page-views on GTM and the GA code above).
I prefer to track what I want using just GTM. Any help would be appreciated. Let me know if the image is hard to see (May need to zoom in). Thanks
one possible solutions is using GTM custom events:
1) adjust your code to trigger custom event instead of sending GA event:
$(document).on('change', 'select', function(e) {
dataLayer.push({
'event': 'widget data selected',
'selected_value': $(e.currentTarget).val()
});
});
This will trigger specific widget data selected select that can be catched with Custom Event Trigger. Then just use that trigger for your regular Analytics Event GTM tag.
Additionally, you might set up user-defined Data Layer variable to read the selected option value from dataLayer and use it in your tag.
I can’t catch the target with the event type, the rest of the targets (via the transition link) work successfully
doing so
Goal Setting -> Own
Target Description -> Event
Target Details ->
Category equals custom
Action equals add_2_order
here
In the code I do it and does not work:
gtag('event', 'add_2_order', {'event_category':'custom'});
still did and still doesn't work
gtag('event', 'my_add_2_order', {'event_category':'custom','event_action':'add_2_order'});
still true .. what am I doing wrong and where to look?
gtag in the head is inserted, but not a single event target works and all goals work if they hit the page
This is the right code:
gtag('event', 'add_2_order', { 'event_category': 'custom' });
If it doesn't work it means that something is blocking the event and you can't find it in the event report either.
Tracking outbound links and forms can be tricky because most browsers will stop executing JavaScript on the current page once a new page starts to load.
This can be mitigated by setting 'transport': 'beacon'.
According to this support page, which I have followed, I have been able to set this up correctly.
<script>
var trackOutboundLink = function(url) {
ga('send', 'event', 'outbound', 'click', url, {
'transport': 'beacon',
'hitCallback': function(){document.location = url;}
});
}
</script>
And my links do this:
Check out example.com
When I test click on it, I can see it registered on RealTime > Events:
And yet when I try to set a goal the event is not seen:
Admin > Goal > new Goal > Custom > Event > Goal Details set to outbound and click:
And yet when I click on verify goal, it says nothing like has been found in the last seven days. I have waited for many hours and still nothing is seen, even though the real-time event is seeing the clicks.
What am I missing, please?
UPDATE:
After waiting for 24 hours, I can see the event showing up in the report section. However, the goal verification still can't see it.
If it is not available in the regular reports either it most likely is a matter of waiting a bit longer. It can take up to 24 hours for events to show up in reports.
Please let us know if that was indeed the problem