Google Tag Manager
Overview
This guide will walk you through integrating Capacity's chat interface into your website using Google Tag Manager (GTM). Once implemented, visitors to your website will have instant access to your organization's knowledge base through an intelligent chat widget.
Prerequisites
Before you begin, ensure you have:
- Active Google Tag Manager Account - With access to your website's GTM container
- Capacity Concierge Token - Located in the Capacity settings - concierge - at the top right corner
- Website Administrator Access - To publish GTM changes
- Testing Environment (recommended) - To validate the integration before going live
Step-by-Step Integration Process
Step 1: Access Your GTM Container
- Log into your Google Tag Manager account
- Select the GTM container associated with your website
- Ensure you're working in the correct workspace
Step 2: Create a New Tag
- Click "Tags" in the left navigation menu
- Click the "New" button to create a new tag
- Click on the tag configuration area to open tag type selection
Step 3: Configure Tag Settings
- Choose Tag Type:
- Select "Custom HTML" from the tag type options
- Select "Custom HTML" from the tag type options
- Name Your Tag:
- Enter a descriptive name like "Capacity Chat Widget" or "AI Knowledge Assistant"
- This helps with organization and future maintenance
- Add the Capacity Code:
- In the HTML field, paste the following code exactly as shown:
<script type="text/javascript">!function(){
var si = document.createElement("script");
si.type = "text/javascript";
si.async = true;
si.src = "https://cdn.aisoftware.com/concierge/index.js";
si.id = "ais-concierge-script";
si.setAttribute("concierge-token", "***INSERT-YOUR-TOKEN-HERE***");
document.body.appendChild(si);
}();</script>
- In the HTML field, paste the following code exactly as shown:
- Insert Your Token:
- Replace
***INSERT-YOUR-TOKEN-HERE***
with your actual Capacity concierge token and ensure there are no extra spaces or characters around your token
- Replace
Step 4: Set Up Triggers
- Click on the Triggers to configure when the tag fires
- Click on "New"
- Click on Trigger Configuration
- Choose Your Trigger Strategy:
- Choose Your Trigger Strategy: Option A: DOM Ready(Recommended)
- "DOM Ready" as a trigger, the tag will fire once the DOM is fully built
- This provides the most comprehensive user experience
- Option B: Specific Pages
- Create a custom trigger if you only want the widget on certain pages
- Configure page URL conditions as needed
- Example: Only on support or contact pages
- Choose Your Trigger Strategy: Option A: DOM Ready(Recommended)
- Click "Save"
- Add the Trigger to your Tag
- Save Trigger Configuration
Step 5: Test Your Implementation
- Enable Preview Mode:
- Click "Preview" in the top right corner of GTM
- This allows you to test without publishing changes live
- Visit Your Website:
- Navigate to your website in a new tab
- GTM Preview mode should be active (you'll see a debug panel)
- Verify Tag Firing:
- Check that your Capacity tag appears in the "Tags Fired" section
- Look for your tag name in the GTM debug panel
- Test Chat Widget:
- Confirm the chat widget appears on your website
- Test a sample question to ensure it's responding correctly
- Check widget appearance on different devices/screen sizes
Step 6: Publish Your Changes
- Return to GTM Interface:
- Exit preview mode once testing is complete
- Submit Changes:
- Click "Submit" in the top right corner
- Add a descriptive version name (e.g., "Added Capacity Chat Widget")
- Include notes about what was changed
- Publish:
- Click "Publish" to make your changes live
- Your Capacity chat interface is now active on your website
Congratulations! Your website now features Capacity's AI-powered chat interface. Visitors can instantly access your organization's knowledge base, improving user experience and reducing support inquiries.