AWS with Google Tag Manager and Firestore

0

Hello,

If I set up Google Tag Manager Server-Side with AWS, do you think that if I include Google Cloud credentials on AWS, I can query Firestore from inside the GTM Server-Side? If so, can you provide with some details or steps on how to achive this?

Google Cloud https://developers.google.com/tag-platform/tag-manager/server-side/manual-setup-guide

Alina
질문됨 2달 전368회 조회
1개 답변
0

While Google Tag Manager server-side on AWS could potentially query Firestore, there are some important considerations: [1]

  • GTM server-side containers run inside AWS, so any Firestore access would need to go through Google APIs over the public internet, which may impact performance.
  • You'd need to configure a Google Cloud service account in AWS with the proper Firestore permissions and securely pass the credentials to the GTM container.
  • GTM JavaScript variables and tags run at a lower privilege level than server code, so some Firestore operations may not be supported.

As an alternative, you could build a Lambda function that queries Firestore and passes the results to the GTM container as custom JavaScript variables. This keeps the Firestore access centralized in AWS rather than distributing credentials. Some key steps:

  • Use AWS Secrets Manager to store your access keys
  • Write a Lambda function that uses the service account to access Firestore
  • Configure a GTM trigger to call the Lambda function on relevant pageviews
  • Return Firestore data from Lambda to populate GTM variables

Let me know if any part of the process needs more explanation. The Lambda approach may perform better while still integrating Firestore data into your GTM container.

Source:

[1]: Guidance for Using Google Tag Manager for Server-Side Website Analytics on AWS

profile pictureAWS
답변함 2달 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인