Can't find a way to set the debug_mode parameter using Measurement Protocol 4. Tried to put it everywhere (and naming it all i can think of) but without luck :) Documentation is still very light and doesn't mention the debug_mode. With web/js and GA4 it works fine!
Weird. Suddenly the debug mode started to work with code I'm 100% sure didn't work before.
Adding the parameter debug_mode = true to the measurement protocol 4 request will make it show up in analytics DebugView.
Sample json payload that works:
{
client_id: 'XXXXXXXXXX.YYYYYYYYYY',
events:
[{
name: 'page_view',
params:
{
page_location: '....',
page_path: '....',
page_title: '....',
debug_mode: true
}
}]
}