Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Missing HTTP request logs in Cloud Run (GTM tagging server)

Hi, I'm running a GTM tagging server using Cloud Run.

I've noticed that by default all incoming HTTP requests are logged. (from run.googleapis.com/requests)

However I also created a custom template in the server container in GTM that logs all the tags fired for each received event, using this addEventCallback function.

So, while looking at the Cloud Run logs I started to notice that there were more logs coming in from the 'logging' custom template I set up than from the inbound HTTP requests.  Which I suppose means the HTTP request to my Cloud Run tagging server was successful but it somehow didn't get a log. Is this common behavior or is there something wrong with my Cloud Run or GTM template setup?

 

0 3 487
3 REPLIES 3

I'd check the GTM templates you deployed and the source URLs on the GTM server (Send data to server-side Tag Manager  |  Google Tag Manager - Server-side  |  Google for Developers) - I'd also ensure a simple community tag was deployed like Tag Manager Template Gallery (google.com)Tag Manager Template Gallery (google.com) or Tag Manager Template Gallery (google.com) to baseline session flows and ensure debugging of variables or other templates. As you look at the server_url configuration check the event parameter settings

djs_75_0-1723652462386.png

 

Thanks for the reply! I have already set up a Google Tag with the appropiate `server_container_url`, the weird thing is that my 'tags fired' logs don't always match the HTTP request logs. And even for those missing HTTP logs if I look into big query I can see that the GA4 event was actually stored there successfully. 

My logging template looks similar to this:

```

addEventCallback(function (containerId, eventData) {
console.log("Fired tags: ", eventData.tags);
});

data.gtmOnSuccess();


```

I'd put it in Debug or Preview mode for the template and see if the behavior and data persists; there have been issues with different event type (example [Solved] Click Element not working in Google Tag Manager (analyticsmania.com)) as it presents client side versus service side - there are a number of articles on this blog explaining why it might not fire as expected, I'd start with 28 Google Tag Manager Debugging and Testing Tips - Analytics Mania 

or 8 Reasons Why a Tag in Google Tag Manager is Not Firing (analyticsmania.com)

 

Top Solution Authors