Search code examples
google-analyticsgoogle-tag-managerfirebase-analyticsmeasurement-protocolgoogle-tag-manager-server-side

Sending data from mobile app GTM to Server Side GTM doesn't work


I want to send data from Google Tag Manager for mobile apps to Server Side GTM (SGTM). I found that it is possible to do it in docs - https://developers.google.com/tag-platform/tag-manager/server-side/send-data#mobile_apps. Basically I have done everything that is mentioned in docs, but nothing works for me.

Firebase SDK is implemented and custom events are being tracked.

Reproduction:

  • Created new custom tag in GTM - Image tag and deselect Enable Cache Busting
  • Set image url with measurement protocol v1 parameters https://gtm-mr75kmv-mgm5n.uc.r.appspot.com/app?v=1&t=macbook&tid=UA-221581298-1&cid=1708627578.1669299303&dp=dev-tools
  • Set trigger to All events
  • Created GA3 client in SGTM that listens on path /app

Problem:
I don't see any requests in SGTM.

Things I have tried to solved it:

  • Check if Mobile App GTM passing data to Google Analytics - yes it works. Value app+gtm is added to parameter firebase_event_origin and I can see data in debugView.
  • Verify if hit is valid. Yes it is valid. I have validated with https://ga-dev-tools.web.app/hit-builder/
  • Verify if SGTM container is configured properly. Yes same hit is being sent from Website GTM and correctly can be seen in Preview mode under Request. (Tag as Custom Image)
  • Select Enable Cache Busting in Custom Image Tag settings. Still can't see the request.

It is narrowing the problem to mobile app google tag manager and especially custom image tag. Does this tag work? Isn't there needed further implementation within mobile app in order to start this Custom tag?


Solution

  • SGTM supports only http header with special value. Therefore it is not possible to see events in preview mode from mobile app (at least I don't know how).

    Solution: Check BigQuery logs in the same project as SGTM deployed.