All Collections
Integrations
Google Tag Manager
Google Tag Manager setup for lead generation event tracking
Google Tag Manager setup for lead generation event tracking

Learn how to setup Google Tag Manager lead generation event tracking.

Updated over a week ago

Step 1: Create a Google Tag Manager Web Container

  1. Navigate to the Google Tag Manager website.

  2. Click Start for free.

  3. Sign in with your Google account.

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

  5. Click Continue.

  6. Next, you'll need to set up a container. Usually, you'll want to create a container for each separate web domain you have.

  7. Enter the name for your container. This could be the name of your website.

  8. Choose "Web" container.

  9. Click "Create."

Step 2: Add GTM Code to Your Website

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

  2. After you've added the code to your website, click "OK."

Step 3: Create Cometly Base Code Tag

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.

  1. In your GTM workspace, click "Add a New Tag."

  2. Name your tag 'Cometly Base Code'

  3. Click on "Tag Configuration" and choose a custom HTML tag.

  4. Set Trigger to 'All Pages'.

    1. Each space (workspace) inside Cometly has a unique script. It's a requirement that the script is installed on each page of your site just above the </head> tag for Cometly to accurately attribute events

Step 4: Create Tags For Any Cometly Events

In the example below, the setup is for the Lead event in Cometly.

  1. In your GTM workspace, click "Add a New Tag."

  2. Name your tag 'Cometly - Lead'

  3. Click on "Tag Configuration" and choose a custom HTML tag.

  4. Enter the Cometly Lead event:

    1. <script>
      comet('lead_generated');
      </script>

  5. Navigate to 'Advanced Settings' > Tag Sequencing, and select 'Fire a tag before Cometly - Lead fires'. Choose the Setup tag 'Cometly - Base Code Pixel'.

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

  7. Your Lead event should look like the example below.

    1. The Trigger can be anything you want that will trigger the event to fire.


      โ€‹

Did this answer your question?