1. Initial Setup of GTM Server

Understanding the Docker Image

docker pull gcr.io/cloud-tagging-10302018/gtm-cloud-image:stable

Reconstructing the Server Installation


2. Running Dual Instances for Preview and Setup

The Need for Two Instances

Preview Server Configuration

-e RUN_AS_PREVIEW_SERVER=true
docker run -d \
--name gtm-preview \
-p 4000:8080 \
-e CONTAINER_CONFIG=<config-string> \
-e RUN_AS_PREVIEW_SERVER=true \
gcr.io/cloud-tagging-10302018/gtm-cloud-image:stable

Tagging Server Configuration

docker run -d \
--name gtm-server \
-p 3000:8080 \
-e CONTAINER_CONFIG=<config-string> \
gcr.io/cloud-tagging-10302018/gtm-cloud-image:stable

3. Google Tags: Transition and Configuration

Google Tags vs GA4 Tags

Setting Up Google Tags

https://www.example.com/tag

Common Issues


4. Nginx Reverse Proxy Configuration

Basic Setup

location /tag {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;