Blog
A single mirror webhook to your warehouse turns sGTM into a free real-time event stream.
Once sGTM forwards events to GA4, Meta, and others, adding one more webhook for your own warehouse is a small change with disproportionate value.
A single Custom Tag in your sGTM container, triggered on all events, posts the payload to a webhook that lands the data in your warehouse.
const event = {
event_name: getEventData('event_name'),
timestamp: Math.floor(Date.now() / 1000),
user_pseudo_id: getEventData('client_id'),
page_location: getEventData('page_location'),
event_params: getAllEventData()
};
sendHttpRequest('https://webhook.example.com/events', {
method: 'POST',
body: JSON.stringify(event),
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + WEBHOOK_TOKEN
}
});
A small Cloud Function that receives the POST and writes to BigQuery via streaming insert. Mirror the GA4 BigQuery export schema. The parallel BigQuery pattern covers this.
Cost: BigQuery streaming insert is about $0.05 per million rows. For 5M events per month, infrastructure totals around $5-10.