I initially created this repository to simplify the process of deploying GTM server-side containers on Heroku, which was free at the time. However, since Heroku’s pricing model has changed, this repository is no longer actively maintained.
First create a Tag Manager server side container and selecet "Manual deploy" option to get your container key.
Create one preview container using the "Deploy to Heroku" button above. Fill your CONTAINER_CONFIG
key, set RUN_AS_PREVIEW_SERVER
to false and leave PREVIEW_SERVER_URL
empty.
After the deploy is complete copy the url of the preview server you just created.
To verify if the deploy was successful go to https://your-preview-server.herokuapp.com/healthz. The status should be "ok".
Now create a new container using the "Deploy to Heroku" button above. Fill your CONTAINER_CONFIG
key. Set RUN_AS_PREVIEW_SERVER
to false and fill the PREVIEW_SERVER_URL
with the url you just copied.
Verify it going to the url https://your-server.herokuapp.com/healthz. The status should be "ok".
https://developers.google.com/tag-manager/serverside/manual-setup-guide
https://developers.google.com/tag-manager/serverside#create_a_new_tag_manager_server-side_container