Step 1: Create a Google Tag Manager Web Container
Navigate to the Google Tag Manager website.
Click Start for free.
Sign in with your Google account.
After signing in, you'll be directed to the GTM Account Setup page. Here, you'll need to provide an account name (usually your business name) and select your country.
Click Continue.
Next, you'll need to set up a container. Usually, you'll want to create a container for each separate web domain you have.
Enter the name for your container. This could be the name of your website.
Choose "Web" container.
Click "Create."
Step 2: Add GTM Code to Your Website
You will see a pop-up window with two blocks of code. The first block should be added as close as possible to the opening
<head>
tag. The second block should be added immediately after the opening<body>
tag. This code should be added to every page of your website.After you've added the code to your website, click "OK."
Step 3: Create Cometly Base Code Tags
Important: Ensure that you do not have the Cometly base code pixel hard coded on your site and in GTM. This will cause the pixel to be added on your website twice and will cause tracking issues. If you are setting up with Google Tag Manager, ensure it's only in Google Tag Manager and not hard coded on the site.
In this step you are going to create two tags separating the Cometly base code into two tags. The goal is to have the second tag firing AFTER the first tag fires.
Here is an example Cometly base code below:
(do not use the code below, this is for example purposes)
<script src="https://t.cometlytrack.com/e?uid=EXAMPLE"></script>
<script>
comet('init');
</script>
Your two tags will look like this:
Tag 1 - Cometly Base Code
(do not use the code below, this is for example purposes)
<script src="https://t.cometlytrack.com/e?uid=EXAMPLE"></script>
Tag 2 - Cometly Base Code
<script>
comet('init');
</script>
For Tag 2, navigate to 'Advanced Settings' > Tag Sequencing, and select 'Fire a tag before Tag 2: Cometly Base Code fires'. Choose the Setup tag 'Tag 1: Cometly Base Code'.
Step By Step Instructions:
Tag 1 Setup
In your GTM workspace, click Add a New Tag.
Name your tag 'Tag 1 - Cometly Base Code'
Click on Tag Configuration and choose a custom HTML tag.
Paste the first part of your Cometly base code:
β(do not use the code below, this is for example purposes, use the workspace pixel)
<script src="https://t.cometlytrack.com/e?uid=EXAMPLE"></script>
Set Trigger to 'All Pages'.
Tag 2 Setup
In your GTM workspace, click Add a New Tag.
Name your tag 'Tag 2 - Cometly Base Code'
Click on Tag Configuration and choose a custom HTML tag.
Paste the second part of your Cometly base code:
β(do not use the code below, this is for example purposes, use the workspace pixel)
<script>
comet('init');
</script>
For Tag 2, navigate to 'Advanced Settings' > Tag Sequencing, and select 'Fire a tag before Tag 2: Cometly Base Code fires'. Choose the Setup tag 'Tag 1: Cometly Base Code'.
Set Trigger to 'All Pages'.
Step 4: Send events to Cometly
Server Events (Recommended)
Use a direct integration or Zapier to send server events to Cometly.
Browser Events
In the example below, the setup is for the Lead event in Cometly.
In your GTM workspace, click "Add a New Tag."
Name your tag 'Cometly - Lead'
Click on "Tag Configuration" and choose a custom HTML tag.
Enter the Cometly Lead event:
<script>
comet('lead_generated');
</script>
Navigate to 'Advanced Settings' > Tag Sequencing, and select 'Fire a tag before Cometly - Lead fires'. Choose the Setup tag 'Cometly - Base Code Pixel'.
Choose the appropriate trigger to fire depending on your set up. The easiest solution is to create a Page View trigger that fires on a Page URL that contains part of the URL. For example, /thank-you
Your Lead event should look like the example below.
The Trigger can be anything you want that will trigger the event to fire.
β