Skip to content

Latest commit

 

History

History
41 lines (20 loc) · 1.97 KB

File metadata and controls

41 lines (20 loc) · 1.97 KB

Google Tag Manager Server Side Container manual deploy to Heroku

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.

Deploy to Heroku

Deploy to Heroku

Instructions

First create a Tag Manager server side container and selecet "Manual deploy" option to get your container key.

Screenshot

Deploy the preview server

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.

Screenshot

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".

Screenshot

Deploy the server side container

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.

Screenshot

Verify it going to the url https://your-server.herokuapp.com/healthz. The status should be "ok".

Further Reading

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