Follow the steps below to install and configure the SiteHound javascript on your website. Yay!
Drop the SiteHound tag into your website templates - or via a tag manager.
Use a few lines of Javascript to specify the key events you want to track, based on your site’s URL structure, <body> CSS classes, or your own custom script.
Analyse your data - including all SiteHound events and properties - via Mixpanel or any tool you have connected via Segment.
If you already have tracking set up
SiteHound is compatible with your existing tracking - installing the library should have no adverse effects, and will automatically enhance your existing events with additional properties in addition to the events it tracks automatically.
Installing SiteHound
To install SiteHound, you just need to add some Javascript to the <head> of your website.
If you use a tag manager, you can paste the scripts below into a custom HTML tag.
You can use the same scripts (snippets and configuration) on all pages of your site.
1 - Add the Segment.com snippet
SiteHound relies on the Segment.com snippet to send data to your analytics tooling, so ensure that’s included first:
Copy/paste the snippet from the Segment.com web interface setup page.
The snippet looks like the example below.
Ensure the API key for the correct project is filled out in the call to analytics.load().
2 - Add the SiteHound snippet
Copy and paste the below into your site after the Segment.com snippet. Simples. 👌
3. Add config for your site & trigger the tracking when done
You can use the same config Javascript on all pages - just paste into your HTML template after the snippets above.
See the API reference for details of all config options.
4 - Use methods to track your custom events
This passes events through to Segment, ensuring they have all the appropriate traits added by the library.
identifyOnce, trackOnce and trackAndCount provide some useful additional functionality.
Meta-tracking: tracking info, warnings and errors about our tracking
If useful, you can make use of the following methods to track things that go wrong or unexpected events for further investigation:
Next: Refer to the API Reference for full documentation, or the User Guide for how to work with the data SiteHound collects.