Installation
Installation overview
The Survicate tracking code needs to be installed to show surveys in your web app or website. HTML code snippet can be installed:
- Manually
- Using Google Tag Manager Plugin
- Using Wordpress Plugin
- Via Segment
We advise using the HTML code snippet when setting up the Survicate Javascript SDK. By doing this, you're guaranteed to have the most recent version of our SDK. This approach reduces the engineering team workload as there's no need to update each time Survicate rolls out a new SDK version. This way, you always stay updated with the newest features from the latest SDKs.
For teams who favor using a package manager, Survicate can also be downloaded via NPM. But, it's worth noting that your engineering team will need to make additional efforts to update and benefit from the newest features and fixes. This NPM installation option is a feature exclusive to our enterprise plan.
Workspace Key
Workspace key is a unique identifier of your teamspace on Survicate account. It will be needed to complete the installation. Your workspace key can be obtained via your Survicate account here
Installation methods
Manual installation
Place this code right before the </body>
tag of your website or web app.
Information about the code being installed is sent to Survicate the moment your site is loaded with our code on it.
To verify installation on your own, you can use the _svc method in the browser console. It should return your Workspace Key.
Segment
Survicate can be installed with Segment. Follow these instructions, to add Survicate as a destination in Segment.
WordPress
Use our WordPress plugin to install Survicate on your WordPress website. Follow these instructions and use this workspace key during the installation.
Google Tag Manager
To install Survicate using Google Tag Manager, follow this article.
Identify users
Each time a user answers a Survicate survey they're assigned a unique, anonymous ID. For most companies it makes sense to have these responses identified. To do so, you can pass user IDs and attributes from your website or web app.
This should be done before initialization of Survicate tracking code.
Here's a sample implementation:
User attributes
Survicate lets you also pass other attributes. Attributes provide deeper insight into collected feedback. You can use them to target the right audiences and filter survey results. Some example attributes that can be passed to Survicate are:
- Company name
- Subscription name
- Signed up date
A user’s attributes can be seen on their profile in the respondents tab. Currently, we support the following types of attributes:
- string
- numbers (integers and decimals, positive and negative)
- boolean
- date
Setting up user attributes should be done before initialization of Survicate tracking code, to ensure that attributes are passed to Survicate.
If attributes are not available before initialization of Survicate tracking code or you want to update them later, you can use the Set visitor traits method.
Here's a sample implementation: