There are two ways you can add CrowdHandler API script to your site.
If you have access to your html and/or templates you can add the script manually.
If you don't, or you prefer not to get your hands dirty, you can add the script using Google Tag Manager.
Getting your Public API key
In either instance you’ll need your Public API key.
To get your Public API key log in to https://admin.crowdhandler.com and go to your Account.
Click on API in the Account navigation.
You'll see your Public API key at the top of the screen.
You can either click on the clipboard to copy the Public API key or select the code and copy it.
Adding the script manually
Insert the following script tag into the head of all pages that you want to protect.
Replace <ch-public-key> with your Public API key.
e.g. If your Public API key is 123456abcedf123456abcedf123456abcedf123456abcedf123456abcedf123 then your script tag will be
Note: It is important that this script is run as soon as possible so we recommend that you insert it before all other script tags
Using Google Tag Manager
This tag will apply CrowdHandler to your site, allowing us to handle the crowds and needs to be added only once.
Important: Before you start, please make sure that Google Tag Manager is set up correctly on your website, according to the Google Tag Manager installation guide. Specifically, make sure that the <script> element of your Google Tag Manager container appears early on in the <head> section of your site and the <noscript> element appears at the beginning of the <body> section.
Here’s how to install CrowdHandler on a website via Google Tag Manager:
1. Download the template
You’ll find a template at the bottom of this article. Download it to your computer, we’ll be needing this shortly.
2. Create a new template in Google Tag Manager
Click on Templates in the Google Tag Manager menu
Then select New from the Tag Templates panel.
3. Import the Tag Template
Click the Dots at the top right of the Google Tag Manager interface to reveal the menu and select Import.
Then navigate to your downloaded template.tpl file and import.
Click Save and close the editor.
The tag template should now be available in your tag templates menu.
4. Add the Tag Template
Now select Tags from the Google Tag Manager menu and click New.
5. Connect to CrowdHandler
To connect your site to CrowdHandler, you need to specify your Public API key.
Paste it into the Public API Key field in the Tag Template.
It’s important that this tag fires as soon as possible so open up the advanced settings and set the Tag firing priority to a high number.
In the Triggering section, create a new trigger by clicking on the Triggering section and then click the plus (+) symbol.
You will need to restrict the trigger to only fire on your production domain and protocol, (unless you are explicitly trying to test on a staging or development environment, in which case you’ll need to ensure those domains are set up on CrowdHandler), so select Page View as the trigger type, choose This trigger fires on Some Page Views as the condition and create a condition that best suits your use case.
Name your trigger and click the Save button.
Now choose a name for your tag and click the Save button.
Click the Submit button and choose Publish on the next screen to publish the changes.
That's it! The CrowdHandler script has been added to your site so we can handle the crowds and you can handle the sales!