Track visits, conversions, and other metrics in your checkout flow by using a tag manager. A tag manager such as Google Tag Manager allows you to manage your tracking scripts in one place, and set advanced tracking events without having to constantly update your Firmhouse project configuration.
Please note, adding custom analytics code is only available for Firmhouse projects that have a custom domain configured.
We'll use Google Tag Manager as a sample in the following instructions. But you can use this article to embed any tag manager of your preference into your Firmhouse projects.
Adding tag manager integration code to your project
You can easily add the custom JavaScript code of your tag manager on your Firmhouse Checkout flow.
Steps:
In your Firmhouse project, go to Checkout Flow in the sidebar and click on Preferences from the submenu that shows up.
Copy the tag manager code that needs to appear in the <head> of the page in the Header field.
Copy the tag manager code that needs to appear in the <body> of the page in the Body field.
Scroll to the bottom and click Update project.
If you're copy-pasting your tag manager code from a piece of documentation: please make sure that you replace the sample container ID with your actual container ID. For example: GTM-XXXX should be replaced with your actual GTM container ID.
View the checkout flow on your custom domain to make sure that your integration code works and that your tracking scripts are loaded in by your tag manager.
Add scripts for the Self service center separately
Within the Firmhouse Self service center, it's also possible to add custom code. This allows for separate tracking scripts and customizations for instance.
Within the Self service center menu, add your code to the Header or Body fields.
Removing tag manager integration code from your project
Steps:
In your Firmhouse project, go to Checkout Flow in the sidebar and click on Preferences from the submenu that shows up.
Clear the tag manager code from the Header field.
Clear the tag manager code from the Body field.
Scroll to the bottom and click Update project.