Google Tag Manager Integration

Follow this article for implementation updates **Google Tag Manager (GTM) is a tool that Google created to help non-web developer staff integrate "tags" or third-party add-on software onto their websites. A common use case for this is adding Google Analytics to the site.

When Google Analytics (GA) is installed in this manner, you need to go through several steps to allow Knock Bot to pass GA event information through to your GA account. This article assumes that you have a working knowledge of Google Tag Manager. If you do not, be sure to consult Google's documentation and your Google account manager for assistance in that.

Setting up in Knock

To set up Knock Bot to begin sending events to your Google Tag Manager installed Google Analytics account, first, you must set that up in Knock. To do this, follow the steps below.

  1. Log into your admin dashboard at
  2. Go to the "Doorway" section
  3. Open up the property you'd like to update and check the "Send Google Tag Manager Events" checkbox

Once the data is feeding in, you will need to configure your GTM to watch for the events and consume their metadata so that you can format messages to go into GA4. Although Knock does not build GTMs, we have a few steps to suggest that may help you in this. These are suggestions and not exact formatting, based on how your GTM is configured.

** IMPORTANT ** Do not copy and paste from this file. You need to type everything in.
Word does strange things like transform hyphens and adjust quotations, if you copy and paste, string-matching may not work. 


1. GTM Variables

  • Load the Variables Page 

  •  Click New:
      • i. Name your new Variable “DL-Doorway_event_category”
        ii. Variable type – Data Layer Variable
        iii. Data Layer Variable name – eventModel.event_category
          • You get this by running tag assistant on the site, and looking at the “Data Layer” tab for the GTM container. Clicking on Doorway on the site will generate events and you can observe the data layer values.
          • Save the Variable 

  • Click New:
      • i. Name your new Variable “DL-Doorway_event_label”
        ii. Variable type – Data Layer Variable
        iii. Data Layer Variable name – eventModel.event_label
        iv. Save the Variable

2. GTM Triggers : We need to create a trigger that leverages the variables we created so that we can fire a tag only when someone interacts.   

  • Load the Triggers Page 

  •  Click New:
      • i. Name your Trigger “Doorway – Scheduling”
        ii. Type – Custom event 
        iii. Event name - This is the event you’re watching for from tag assistant, in this case we’ll use “Scheduling” 
        iv. This trigger fires on 

          • Here we need to make sure this tag only fires on the type of scheduling interaction we want.

          • Change the first dropdown to the event_label variable we created 

            DL-Doorway_event_label | contains | “Viewed -

          • Create a second row for the next event variable 

            DL-Doorway_event_category | contains | Knockbot 

iv. This trigger fires on 


2. GTM Tag: We need a tag to take some action. In this case it will be a GA4 event 

  • Go to the tags tab 

  •  Click New:

      • i. Name your new Tag “Doorway – Scheduling Event ”
        ii. Input your measurement ID 
        iii. Event name – This is the event’s name from tag assistant. In our case “Scheduling”
        iv. Event Parameters 

            • Here you’ll include whatever you want to send through to GA. 

              > We’ll add 2 
              > event_category | (add the doorway event category from our variable earlier) 
              > event_label | “Scheduling Opened” 

            • This could also be a variable, but the language might be non-intuitive so I’ve entered a static string.

v. Triggering:


vi. Save the Tag


  • At this point you can load your website in tag assistant and observe the events that happen when you click on doorway’s buttons.  You should see a tag get fired when schedule a tour is clicked. 
  • You can observe network traffic to see the specific GA4 events being pushed to GA4 from your browser. Search for “collect” to see just those messages going to Google.
Was this article helpful?
0 out of 0 found this helpful



Article is closed for comments.

Articles in this section