This Event reference page lists lots of interesting events but where is the documentation for the basic ones like "page_view", "event", "timing" and "exception" ?
The page_view is in the document you provided
https://developers.google.com/tag-platform/gtagjs/reference/events#page_view
About the event :
In GA4 everything is an event.
Not like the UA distinct the hit type to pageview, event, timing....
So you can custom all the event if you need.
If you don't have idea, here is the recommend event document
https://support.google.com/analytics/answer/9267735?hl=en
Related
We parse our streaming server logs and post as events using the Measurement Protocol in Google Universal Analytics. I having a hard time finding how or if this could work in GA4. Here is an example post we POST using curl from a PHP script for someone listening to one of our HD channels:
v=1&tid=UA-123456789-1&cid=a76-b177-b238-b39d-634225a16b6e&ds=web&ua=AppleCoreMedia%2F1.0.0.19G71%20%28iPad;%20U;%20CPU%20OS%2015_6%20like%20Mac%20OS%20X;%20&ul=en-us&uip=1.2.3.4&cs=event&cn=station&cm=stream&ck=WXYZ%20HD3%20The%20Channel&t=event&ec=Stream&ea=Listen&el=WXYZ%20HD3%20The%20Channel&ev=10&cg1=Hour10&cg2=channel&cg3=Midday%20Weekdays%209am-1pm
We can then view these Events under Behaviors in Universal Analytics in our Event Category of Stream. I wrote this script using the Measurement Protocol parameter reference that clearly now shows a link to the Measurement Protocol in GA4 at the top of the page, but there is no similar parameter reference guide. As you can see, we've posted all mainly to categories, actions and labels even with custom groups.
Here is another for someone listening to a show that POSTS to campaign source/media events:
v=1&tid=UA-123456789-1&cid=a97-b76-b210-b2d-634225a16b6e&ds=web&ua=Mozilla%2F5.0%20%28Windows%20NT%2010.0;%20Win64;%20x64%29%20AppleWebKit%2F537.36%20%28KH&ul=en-us&uip=1.2.3.4&cs=event&cn=station&cm=stream&ck=The%20Show&t=event&ec=Stream&ea=Listen&el=The%20Show&ev=10&cg1=Hour1&cg2=podcast&cg3=Midday%20Weekdays%209am-1pm
Could someone be so kind to point me in the right direction if this is possible to convert to GA4 events?
Here is how you can translate an event in Universal Analytics to GA4:
Universal Analytics
Google Analytics 4
action (ea)
Maps to event_name
event_category (ec)
Maps to an event_category parameter with a parameter value
event_label (el)
Maps to an event_label parameter with a parameter value
event_value (ev)
Maps to an event_value parameter with a parameter value
Using your example, this is what the GA4 event would look like
gtag('event', 'Listen', { 'event_category': 'Stream', 'event_label': 'The Show', 'event_value': '10' });
For more information, refer to this Google help center article.
[Edited. Added code sample and more explanations]
Is anybody familiar with the GA4 Measurement Protocol?
We are sending events from our backend servers to the server-side GTM container using the GA4 Measurement Protocol. Everything works fine except for conversion tracking. The events marked as conversion are not counted as conversions if we send those via MP (except for the default "purchase" event, it works perfectly). The same event with the same parameters counts as a conversion if we send it from the browser (client-side GTM). As I couldn't find anything about this issue online, the only thing left was to debug parameter by parameter using the server-side GTM preview mode. Here I discovered, that if I send events from the browser, the requests for events I mark as conversions in GA have "&_c=1" in their query string.
That means, as far as I understand it, that in order to get conversion events via MP, the event request needs to have "_c" query string parameter. I tried adding "_c" as an event param, but that didn't work. Is there a designated JSON parameter to mark the event as a conversion?
------------MORE INFO--------------
Here is an example of an event "Experts". This event gets sent from both the client-side and the server. As you can see in the screenshot, this event is marked as a conversion.
As you can see on the second screenshot, the actual events (137) are much more than the conversions detected (48). The difference are exactly the ones sent from the server-side.
Here is the request body of the server call:
{
"client_id":"Z9TLWnyVC2UK4UssPIVk8J+2n5BZhgWLtWSlFYYSwlg=.1642076344",
"user_id":"119412",
"events": [{
"name": "Experts",
"params": {
"tenweb_action": "[Test action]",
"tenweb_info": "[Some more info]",
"debug_mode":1,
"page_location": "https://10web.io/[some-test-page]"
}
}]
}
#Jan, #DaImTo, and everyone else that might have this issue in the future.
I think I've found a solution. Although it's unofficial and might break at any moment, it's the best one I've found so far. Here is what I ended up doing. While debugging via GTM preview mode I noticed, that in Event Data tab of conversion events there is an object "x-ga-system_properties", that, among other system variables, contains c:"1" . So I tried adding
"x-ga-system_properties":{"c":"1"}
to the event parameters JSON that we send to the Measurement Protocol endpoint of our server-side GTM.
IT WORKED. The events sent that way were registered as conversions by GA4.
Would be great to hear your thoughts on this. Do you think it's a stable solution? Do you think there will be official documentation on this from Google?
The Facebook SDK has the ability to record both custom events and standard events. The standard events are things like "Purchases" "Add to cart" "Completed Registration" etc...
Recording these standard events gives you access to specific bidding features on Facebook ads that you don't get without the events.
I have an app that has the React Native FBSDK
There are two methods for defining an event - one for purchases and one for everything else as seen here
There is zero documentation for standard events on react within the SDK on Github or on the event tracking docs on Facebook's developer platform.
Right now I'm trying to track the standard events by using their various names, as recorded across FB's documentation. I've tried the following:
AppEventsLogger.logEvent('FBSDKAppEventNameCompletedRegistration');
AppEventsLogger.logEvent('CompletedRegistration');
AppEventsLogger.logEvent('Completed Registration');
All of these just create custom events with those names, but aren't recognized as standard events.
Has anyone gotten standard events to work using the React Native wrapper for the FB SDK? If so how do you name the events to get FB to recognize them?
Update: As the comment below highlights, the more recent link is https://developers.facebook.com/docs/marketing-api/app-event-api/
It looks like you'll have to pass the strings that those standard events get evaluated to, i.e. instead of 'FBSDKAppEventNameCompletedRegistration', you'll have to use: 'fb_mobile_complete_registration'.
Here's the source:
Sorry if this is a bit late. Hope this helps.
I managed to find the actual event name by generating standard event code using tool on Facebook's documentation, run the code in AppDelegate.m, and get the exact key-values from Events Manager. With this roundabout way, I realized the actual name of Add to Cart event was fb_mobile_add_to_cart. From there I googled for the name and found the list documented in Marketing API (why not App Events?).
I don't know if it is the right place, but you can refer to https://developers.facebook.com/docs/marketing-api/app-event-api/ for actual standard event names and parameter names. At least it worked in my case. Here's my Add to Cart event code:
function logAddToCart(totalPrice, contentType, contentId, currency) {
const params = {
'fb_content_type': contentType,
'fb_content_id': contentId,
'fb_currency': currency
};
AppEventsLogger.logEvent('fb_mobile_add_to_cart', totalPrice, params);
}
I made a simple package with all events. Just import like
import FBEvents from "react-native-fbsdk-events";
// ...
AppEventsLogger(FBEvents.COMPLETE_REGISTRATITON, params);
Is it possible trigger events based on the timestamp of an embedded Soundcloud track?
I would like to show/hide photos based on the content of the Soundcloud track but not able to find information about this in the API documentation.
Yes, thats possible. Please share some code. What does embedded mean?
I assume you will use JS.
You can use ie timed comments.
https://developers.soundcloud.com/docs/api/sdks#javascript
SC.stream("/tracks/293", {
autoPlay: true,
ontimedcomments: function(comments){
console.log(comments[0].body);
}
});
Or you can use the standard player events and use your own database.
I've been trying to figure out how to do this, and was thinking it wasn't possible, then found this website: (Removed due to a dead link)
You can search by city there and I have no idea how they do it? The normal graph API's don't allow searching for events by location as far as I can see. Any advice/tips/info would be great!
Updated 2014-07-02
You can't directly search the Facebook API for events near a location. Since originally giving this answer, the Graph API has made it harder to search for events.
The Elmcity script referenced by the OP does a simple search for a keyword in the event title. Try "Lancaster" for example. You'll get events that have the word Lancaster somewhere in their metadata.
Their query looks something like this:
https://graph.facebook.com/search?q=lancaster&type=event
You can also search for a non-location based word in the title like "picnic" and the script returns events.
For the problem of actually finding events near a location, in the current iteration the "venue" field is only a string, so it has no relationship to any Facebook place. Running these query returns nothing:
https://graph.facebook.com/madisonsquaregarden/events
https://graph.facebook.com/108424279189115/events
So using a batched request isn't even a possibility.
According to the documentation FQL seems to be a better solution. In the event documentation, the venue.name column is indexable! Easy, right?
Wrong. When you run this FQL query to find events at some location like this:
SELECT name, start_time, venue FROM event WHERE CONTAINS("madison square garden")
You find that venue.name isn't populated.
Trying any other variation like:
SELECT name, start_time, venue FROM event WHERE venue.id = 108424279189115
Throws a "statement not indexable" error.
So while building a "Facebook Events Near Me" is the killer app, the only way that it seems possible is to search for common strings for events near you, get those events, then filter out irrelevant events from the result set.
This JavaScript library on GitHub seems like an interesting approach to look at. It uses a places search and then does an events search on those places.
tobilg/facebook-events-by-location-core
As of recent. the Events end points have been deprecated due to the privacy issue.
Your app will now need to be reviewed first to access events api, when it resumes.
Events and points has been deprecated due to privacy issues. Now you have to review your app before you can access events api. After successful approval you can search events.
So what you can do is enter "Events", but you need to enter the date, or tomorrow after that. Then, on the right, in your filters, enter the location field, select other, then punch in the location you want.