Gather custom events from a React app with Google Analytics 4 - reactjs

I'm using react-ga4 to send custom events to Google Analytics 4. I can see the events in the real-time dashboard and I can see an event with the made up name I'm using in the select of events when creating a custom event with the ui, but I can't find my data in the events tab or anywhere else outside the real-time section.
Is there something I should do on Google Analaytics and/or where can I find the custom data I'm sending?

It takes 24 hours to appear on the events tab

You can also confirm the correctness of your code by checking the event's hit from the networks tab in the dev console of your browser.
The API to GA for your event should start with https://analytics.google.com/g/collect?v.... In the payload tab here, you should be able to view the following fields for your event:
ep.category
ep.action
ep.label
NOTE: It takes upto 24hrs (as mentioned in above answer) for the event to appear in the events section of your GA4 property

Related

Adding an event from a different Google Calendar, with dynamic update

In Google Calendar, I can select an event, click on "publish event", and obtain a URL that another user can use to add the event to their calendar. However, that is a static copy of my event. If I edit my event, the edits are not propagated to the other user's calendar. How can one add an event from another calendar, and then have that event dynamically updated whenever the original is edited?
One approach is to invite every single participant, so that they can individually accept or decline the event. However, that is burdensome when the attendee list is unknown, large, or changes frequently.
This answer is not relevant because I am starting from a Google Calendar, not programmatically creating an iCal event feed.
This answer from 2010 says to manually export the .ics file, put it on a website, advertise it to users, and manually update the served .ics file periodically. Is there a better way today?

Unable to see event_category in Google Analytics 4

I am new to GA and I have integrated my react app with Google Analytics 4 and sent custom events to analytics like this
ReactGA.event({category: 'abc', action: 'xyz'})
This created an event in GA4 but when I am exploring events and reports I couldn't find anywhere the metric/dimension named event_category. Please tell me how can I see the event_category of my events.
I have exactly the same setup, and 'category' does indeed show up as 'event_category' in GA4.
There are many ways to view the event and its parameters. The easiest is perhaps: Reports>Engagement>Events. A dropdown at the top-left allows you to choose your event ('Enquire' here). Then a panel at the right has a dropdown showing all of the parameters; event_category shows up there.
What makes you think ReactGA is applicable for GA4? I glanced at their git repo and it looks like it's made for UA. GA4 is different. It has a different event model, different custom dimensions model, different tracking endpoint, different tracking id format. GA4 doesn't have a native concept of category or action.
You're trying to use a UA library to send GA4 events. Try this one: https://www.npmjs.com/package/react-ga4
Also, read this answer: Google Analytics 4 with React GA4 is still raw, despite the eagerness with which Google pushes it. We normally suggest sticking to UA for a few more years.

Linkedin tracking for single page app in Google Tag Manager

I'm trying to implement LinkedIn's insight tracking tag in Google Tag Manager on a single page React web application. Since there are no 'real' page reloads, the tag is only fired once. I have a dataLayer event that triggers on rerouting in the app, so I tried setting the tracking tag to fire on that event. The tag itself now fires multiple times but it does not track the new location.
What can I do to solve this?
LinkedIn
It is not an official solution but you can add a custom HTML tag including this:
<script>
lintrk("track");
</script>
It will be triggered by History Change event.
You can fire Virtual pageviews on that particular dataLayer events.
What is a Virtual Pageview
Virtual Pageviewsrefers to sending the pageview hits to Google Analytics, without reloading the page. For the single page page app, virtual pageviews are good to track the sections.
Steps
Determine a standard notation for virtual pageview like /vpv/section name
On the Datalayer event, push the value of section name to the website section or something that can let you know which section the user is on.
For reporting, you can now actually see how many views happened for that particular section/page etc
The GTM tag will be normal pageview tag, you just need to put the virtual page path value in the More settings > Basic Configuration like shown below:
As pointed out in the article What Is Google Tag Manager? Do I Need It For My Website?, Google Tag Manager can listen to browser history changes, i.e. History Change is one of the pre-defined trigger in Tag Manager. So it's doable.

GPS tracking in Kinetise application

Anyone here familiar with Kinetise? I try to add to my app some kind of remote tracking functionality, where backend will trigger from active user his GPS position. What first come to my mind was PUSH notifications, but it's rather message notification than event triggering in this tool. In taxi template there is a map with live changing positions, realized by longpooling requests I think. I found that you can add your current position in request params or body and I consider to use this technique to send user location to server, but I think that I would have to add empty lists in each screen, just to send a location. A bit weird but maybe there is any better solution?
#Marek for GPS purposes you have also functions:
GPS TRACKING START
GPS TRACKING STOP
You can add it to buttons from widget "EVENTS" tab.
EVENTS tab
I know it's not triggered by server but can help you meet your requirements.

Geoloqi Geofencing Logic Flow

All,
I have been looking high and low for a solution and at this point I am baffled. I am not looking for code here. I am just looking for the proper logic flow to alert users of my app that an event is taking place nearby using Geoloqi.
My platforms:
Geoloqi: Geofencing
Appcelerator Cloud Services: User, Event and Message Management
Language: javascript
Mobile: iPhone and Android
What I am trying to do:
1) I want users of my app to be able to create an event, then create a trigger based on that event.
2) I want users of my app who are near the event to be automatically alerted that the event is happening.
What I have so far:
1) Create an Appcelerator Event - Works fine
2) Create a Geoloqi Layer including the Appcelerator EventID - Works fine
3) Create a Geoloqi Trigger for the above layer - Works fine
I can see everything getting to the Geoloqi debugger. I just don't see the alert going out. I saw a post that the anonymous user needs to subscribe to the layer in order for the trigger to send to my users inside the trigger geofence. I just don't understand how to do that. I have tried several code permutations around the user/create_anon method with a key using either the anonymous username or the user access token to subscribe to the layer with no luck. I have tried using the access token returned on init as the parameter to subscribe with no luck.
I am wondering, however, if I can get the same effect by using a place instead of the layer, and avoiding the subscription issue. I somehow doubt this as the place has to reside in a default layer.
Color me confused. I already went through hell and back just getting the push certs set up for Apple, so any and all help is greatly appreciated.
Thanks,
Bruce
Bruce,
I'd recommend hitting the geoloqi developer IRC channel. You can get to it from one of the developer pages on their website. The geoloqi guys are usually online and they've been very helpful to me in the past.
If you do get it working, I'd love to hear the solution/flow for it! Hope that helps!
Tyler
OK, so here is what I am doing. Not sure yet if it is the answer, but I think it will work.
Create a default layer with no boundaries and a key that is the same each time the app runs. This will ensure the same layer is used based on Geoloqi's anti-dupe logic.
Create an anon user using the logged in user's email address since I am using Appcelerator to handle the user management. If I understand this correctly, this will also ensure the same anon-user is used if the user logs in again later. The anon user is automatically subscribed to the default layer.
When the user wants to create an event, the app creates an event on Appcelerator, creates a layer with a radius of x, a trigger on that layer, and sends a broadcast message to all users in the default layer using the trigger centerpoint and radius to limit the message to the immediate area.
If the user wants to cancel the event, the app sends a broadcast message to the default
layer in the same way the layer was created, then deletes the Appcelerator event and the layer.
I have all the code hooked in except the anonymous user. I can see the triggers being set and the messages being created on the Geoloqi Debugger, but I don't always get them. I'll be hooking in the anonymous user next week, so we shall see.

Resources