Skip to content

Preview mode not working on Android app with server-side GTM setup #6826

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
comiiino opened this issue Apr 1, 2025 · 5 comments
Closed

Preview mode not working on Android app with server-side GTM setup #6826

comiiino opened this issue Apr 1, 2025 · 5 comments

Comments

@comiiino
Copy link

comiiino commented Apr 1, 2025

Environment

  • Android Studio version: 2024.3.1
  • Firebase Component: Firebase Android BoM
  • Component version: 33.12.0

Problem

I'm currently integrating server-side Google Tag Manager (sGTM) in an Android application following the official guide here:
https://developers.google.com/tag-platform/tag-manager/server-side/server-side-tagging-for-mobile-apps?hl=it

Everything seems to be set up correctly, but the preview mode is not working on the Android app but it's working correctly on the iOS app. I've tried multiple times, including:

  • Verifying that the container URL is correct
  • Using the latest version of the SDK
  • Confirming that the preview parameters are passed in the URL
  • Testing on both emulator and physical device

Despite all this, the app does not connect to the sGTM container in preview mode. There's no log or indication that the preview is active.

Is this a known issue or is there something else I might be missing?

Thanks in advance for your support!

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@lehcar09
Copy link
Contributor

lehcar09 commented Apr 2, 2025

HI @comiiino, thank you for reaching out. I'm currently working on this. By any chance, can you share an Android MCVE and verbose logs from your Android and iOS app? This would help us investigate the issue. Thanks!

@google-oss-bot
Copy link
Contributor

Hey @comiiino. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@comiiino
Copy link
Author

comiiino commented Apr 14, 2025

Hi @lehcar09! Unfortunately, I'm unable to provide a working example since it would involve sharing non-public code. However, I can share some logs — would it be helpful if I generated the usual debug logs using the following commands?

adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC

@lehcar09
Copy link
Contributor

Hey @comiiino, I was able to make the preview mode to work by following the guide you shared. I have the logs below, after scanning the QR code to preview.

Image

That said, it would be best to reach out to the Google Analytics team and/or Google Tag Manager to get better help. The team might need to access your project to troubleshoot this type of issue.

I'll be closing this case now. Let me know if there's any misunderstanding so we can re-open the issue. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants