Gaq push events not showing in GA4 - google-analytics

We are using a custom tracking code to track events in UA, which was fine until now, but as there is a deadline to move all the events in GA4, I have already integrated the GA4 to the website, but I couldn't see those events there. Following is an example of an event I use.
_gaq.push(['_trackEvent', 'EventCategory', 'EventAction', 'EventLabel']);
Homepage=Category , PretSmallBanJan2023Stars = Event name , Banner= Event label
e.g. - _gaq.push(['_trackEvent', 'HomePage', 'PretSmallBanJan2023Stars-CH', 'Banner']);
There are over 15k events like this that are on the current setup which I have to move before July, so if there is any way to keep the same setup and see data in GA4 it will be greatly appreciated.
Kind Regards

You have to consider that in GA4 there are no more Category, Action and Label.
Follow This Link to move to GA4. Remember that there have been some major differences, as an example look at this Comparing metrics: Google Analytics 4 vs Universal Analytics.
In order to define a Custom Event in GA4 follow GA4 Custom Events
In order to define custom events you can use two methods:
1 - GTAG
2- DataLayer
I believe it would be easier if you use the first one or gtag.js API to send info or events to Google Analytic API. However, it is subjected to change(so you might be obligated to change something or update something on and off when Google decides).
1 - GTAG
As it is described in this link Set Up an Event for Website Apps for GTAG,
Before you begin:
Create a Google Analytics 4 account and property Create a web data
stream for your website Place the Google tag on your website It also
assumes that you have the following:
Access to your website source code The Editor role to the Google
Analytics account
To send events to Google Analytics this API has one function called gtag(), and whenever you want to send an event to Google Analytics, you use the following syntax:
gtag('event', '<event_name>', {
<event_parameters>
});
Finally, if you need the same metrics Category, Action and Label I suggest you to create Custom Dimensions for these three. So if you have an old-defined table in your Database, it is not going to change the fields or create loads to the developers. The documentation for creating Custom Dimensions and Metrics is here. Remember that it takes 48 hours for GA4 API to recognise your custom dimensions. There are some limitations as well that you can read at the link above.
2- DataLayer
In this method, you need to work with GTM or Google Tag Manager, as well.
To read more, you can follow this link GTM.

Related

Is it possible to create purchase event for both universal analytics and for Google analytics 4

I have created 2 events with same name 'purchase' for universal analytics and for GA4 but the monetisation report is not correct in both the dashboards.
How can I create purchase event for both Universal analytics and GA4 and show the correct transactions in the report?
Also Can I create custom events like order tracking with product(item) parameter like purchase and create a custom report with all the parameters in the GA account?
Are you using a datalayer push for the ecommerce data that you want to display in your Analytics?
Or are you using dynamic values that you scrape from your website with custom javascript variables?
In any case, you have to include the correct structure in an event for the correct report to work.
I would recommend building a correctly formatted datalayer.push event that corresponds to GA4 standards.
For example:
How a purchase event should look like: https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#make_a_purchase_or_issue_a_refund
Required and optional event parameters: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag
Then you can use a GA4 event tag to capture ecommerce data from the datalayer, and the UA tag has a checkbox that enables it to process GA4 data found in the datalayer.
This approach means that you will only have to support one type of Analytics structure on your website while you get ecommerce reports for both platforms.

How to track custom events in Google Analytics 4 [GA4] vs v3?

In Google Analytics v3 it was possible to send custom events right from the frontend of the application, like:
gtag('event', 'my_custom_search', {
'event_category': 'custom_text',
'event_label': 'custom_label',
'value': 'custom_value',
});
In GA4 it's still possible to send predefined events, like search for example:
gtag('event', 'search', {
search_term: '1234'
});
Now we want to send our custom events again. So I simply tried this:
gtag('event', 'my_custom_search', {
search_term: '1234'
});
Unfortunately the custom event doesn't show up in the realtime view. I found this article to create custom events in the backend: [GA4] Modify and create events via the user interface.
My questions are:
Is it still possible to send custom events "on the fly"?
Must we really create all events beforehand in the Google Tag Manager?
If the anser to the second question is yes, then this is a lot of extra work, because we have to define the events in the Google Tag Manager and also in our frontend.
Current state, you'll have to name/configure them in GA4. Be careful of the limits, as you can't delete them. So no, you can't name them on the fly.
For your example, you'll want to keep it to the default "view_search_results" event, but augment via additional parameters, "type=custom"
As for your GTM question. This depends on how complex your GTM setup is currently and how well your events fit into the GA4 default list of events. Again you'll want to review and fit your existing events into the default events where possible and add new ones only after you've done the full review.
Implementation-wise, you might be able to reduce the number of tags by using a lookup table for existing events to map them to GA4 event parameters.
Edit: also you're referencing "gtag" a lot, it is different from Google Tag Manager. If your current custom events implementation is done through gtag then the migration will be more manual.
The my_custom_search should be able to fire, however, you'll need to install gtag before running your custom code, which is to set up the measurement id with gtag. You can reference google's document at here.

Google Analytics custom event push thru Google Tag Manager

I have Google Tag Manager account created,
And I have Google Analytics account created,
Inside my app I only have GTM included, and after some research, I managed to connect my Google Analytics acc with GTM to track page views.
Now, what I used to do before with just using GA, I was using some custom events inside my app,
So ga('send', 'event', 'Videos', 'play', 'Fall Campaign');
Now I tried to do the same after GTM is connected but I'm not getting any events inside my admin
I also tried doing dataLayer.push with same event arguments and event is still not showing up
Does anyone have an idea of what I'm missing to get custom events working?
Also, I don't want them to be defined inside GTM (that would mean that for every custom event I need to create a trigger if I get it right)
Is it possible to just publish them without any configuration inside GTM?
Thanks!
You have to create Analytics Tag (type event), Trigger and some dataLayer Variables, you can find the guidelines here: https://support.google.com/tagmanager/answer/7679219?hl=en

View dataLayer's data in Google Analytics by event

I do not understand how to catch data from an event in google analytics.
I watch my event
My dataLayer is like the documentation (https://developers.google.com/tag-manager/enhanced-ecommerce#cart)
My question is : How can i see that (product's data and actionField) in Google Analytics ?
Thanks,
The "step" is visible in the Checkout Behavior report in the E-Commerce-Section of the Conversions-Menu (it's displayed as a funnel step in the visualization and you can give it a proper name in the view settings).
Checkout options can be displayed as secondary dimensions, used in segments, custom reports and via the API (they are not part of the standard reports).

Event tracking from Google Analytics not working

I'm trying to use google analytics to track custom events, but when I try to hit the page:
http://www.google-analytics.com/collect?v=1&tid=UA-myUA&cid=1111&t=event&ec=Movement&ea=livingRoom&el=desk
It opens the page like collecting, but in my analytics account, it doesnt show any event....
You'll want to track Google Analytics events using Google Analytics event tracking - https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
You can implement event tracking using Google Tag Manager where you can create you custom events. The procedure is easy to implement than traditional Java Script code as it does not require developer to implement GTM.
Simply follow the below steps for GTM implementation:
1. Log into Google Tag Manager
2. Select “Tags” from the left-hand side
3. Create a new tag
4. Select Universal Analytics from Tag Type
5. Set your Google Analytics Tracking ID
6. Choose “Event” for the track type
7. Set your Event Category, Action, Label and Value as desired*
8. Set your triggers as required
You can refer Google Guidelines for detailed information.

Resources