I recently started using GA4 with measurement protocol api. I have an issue, that doesn't matter how many events, custom or automatic ones I send, they don't appear in standard reports.
I see users in user explorer though:
JS code that I used to send events to api:
fetch(
`https://www.google-analytics.com/mp/collect?measurement_id=${measurement_id}&api_secret=${api_secret}`,
{
method: 'POST',
body: {
client_id: clientId,
user_id: userId,
events: [
{
name: 'first_visit',
params: {},
},
{
name: 'session_start',
params: {},
},
{
name: 'custom_event',
params: {},
},
],
user_properties: {},
},
},
)
I know that GA takes a while to aggregate data, but I waited for 4 days and it still shows 0 everywhere.
Am I missing something? Maybe I need to send a specific event so that GA4 aggregates it? Or am I missing some sort of parameter in the request? Maybe I need to configure something in the project itself?
Any help would be very appreciated.