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 a number of steps to allow Knockbot to pass GA event information through to your GA account. This article assumes that you have 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 Knockbot 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 admin.knockrentals.com
  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
  4. You're done!

Setting up in Google Tag Manager

The steps to set up GTM are as follows:

  1. Create the Variables to correctly receive the Knockbot event data.
  2. Create Triggers to fire the event at the appropriate times.
  3. Input the Tags to get the events into Google Analytics.
  4. Publish your changes!

Variables

Variables are roughly how Google Tag Manager tells what data to look for. There are two variables to set up in GTM.

Category
The Category variable tells Google Tag Manager which Event Category to place the event in. This is always "Knockbot"
To create this variable:

  1. Go to GTM and click the "Variables" option in the left navigation.
  2. Click "New" in the "User-Defined Variables" section of the page.
  3. Title the variable "Category"
  4. For the Variable Type, select "Data Layer Variable"
  5. For the "Data Layer Variable Name" input "category"
  6. Click Save in the top right of the window.

Label
The Label variable tells GTM which Event Label which Event Label to place the event in. This differs based on the user action.
To create this variable:

  1. Go to GTM and click the "Variables" option in the left navigation.
  2. Click "New" in the "User-Defined Variables" section of the page.
  3. Title the variable "Label"
  4. For the Variable Type, select "Data Layer Variable"
  5. For the "Data Layer Variable Name" input "label"
  6. Click Save in the top right of the window.

Triggers

Triggers are how Google Tag Manager knows when to fire a particular event or tag. Knock suggest setting up two triggers to correctly account for events that are non-interactive or events that we believe should not count towards your bounce rate in a positive way.

Interaction Event Trigger
This event trigger will correctly identify when Knockbot is sending events that are true positive interactions with Knockbot. You can modify these rules as you'd like but below are Knock's recommended settings.
To create the trigger:

  1. Go to GTM and click the "Triggers" option in the left navigation.
  2. Click "New" in the "Triggers" section of the page.
  3. Title the trigger "GA Interaction Event" or something else that you will understand.
  4. For the Trigger Type, select "Custom Event"
  5. For the "Event Name" check the "Use regex matching" checkbox and input exactly "Availability|Chat|Contact Form|Greeting|Leasing Special|Message|Neighborhood|Photos|Resident Form|Resident Message|Scheduling|Something Else Form|Text Us Form"
  6. For the "This trigger fires on" radio buttons, select "Some Custom Events"
  7. For Category select "Equals" and "Knockbot"
  8. For Event select "does not match RegEx" and "Greeting"
  9. For Label select "does not match RegEx" and "Received|Closed"
  10. Click Save in the top right of the window.

Non-Interaction Event Trigger
This event trigger will correctly identify when Knockbot is sending events that are not positive interactions with Knockbot. You can modify these rules as you'd like but below are Knock's recommended settings.
To create the trigger:

  1. Go to GTM and click the "Triggers" option in the left navigation.
  2. Click "New" in the "Triggers" section of the page.
  3. Title the trigger "GA Non-Interaction Event" or something else that you will understand.
  4. For the Trigger Type, select "Custom Event"
  5. For the "Event Name" check the "Use regex matching" checkbox and input exactly "Availability|Chat|Contact Form|Greeting|Leasing Special|Message|Neighborhood|Photos|Resident Form|Resident Message|Scheduling|Something Else Form|Text Us Form"
  6. For the "This trigger fires on" radio buttons, select "Some Custom Events"
  7. For Category select "Equals" and "Knockbot"
  8. For Event select "Equals" and "Greeting"
  9. For Label select "matches RegEx" and "Received|Closed"
  10. Click Save in the top right of the window.

Tags

Finally, Tags are the function in Google Tag Manager where the Event is sent to Google Analytics. We will be creating two Tags, one for Interaction Events and one for Non-Interaction Events.

Interaction Tag
The Interaction Tag is the Tag that will fire using the Interaction Trigger from above. This sends the necessary info to Google Analytics and registers an interaction event.
To create the Tag:

  1. Go to GTM and click the "Tags" option in the left navigation.
  2. Click "New" in the "Tags" section of the page.
  3. Title the Tag "GA Interaction Event" or something else that you will understand.
  4. For the Tag Configuration, select "Google Analytics - Universal Analytics"
  5. For the Track Type select "Event"
  6. For the Event Tracking Parameters set Category to "Label" by finding it in the list activated when hitting the plus sign to the right of the text input. Set Action to "Event" in the same way and set Label to "Label" in the same way.
  7. For Non-Interaction Hit choose "False".
  8. For Google Analytics Settings select the variable with your Google Analytics information.
  9. In the Triggering section of the page select the "GA Interaction Event" trigger that you created in the previous step.
  10. Click Save in the top right of the window.

Non-Interaction Tag
The Non-Interaction Tag is the Tag that will fire using the Interaction Trigger from above. This sends the necessary info to Google Analytics and registers an interaction event.
To create the Tag:

  1. Go to GTM and click the "Tags" option in the left navigation.
  2. Click "New" in the "Tags" section of the page.
  3. Title the Tag "GA Non-Interaction Event" or something else that you will understand.
  4. For the Tag Configuration, select "Google Analytics - Universal Analytics"
  5. For the Track Type select "Event"
  6. For the Event Tracking Parameters set Category to "Label" by finding it in the list activated when hitting the plus sign to the right of the text input. Set Action to "Event" in the same way and set Label to "Label" in the same way.
  7. For Non-Interaction Hit choose "True".
  8. For Google Analytics Settings select the variable with your Google Analytics information.
  9. In the Triggering section of the page select the "GA Non-Interaction Event" trigger that you created in the previous step.
  10. Click Save in the top right of the window.

You're done! Google Analytics will now be flowing into your account!

Did this answer your question?