Usermaven accepts the same set of parameters in both the npm package and HTML snippet versions. The only difference is in the naming convention: in the npm package, parameters should be referenced as param_name, while in the HTML snippet they should be referred to as data-param-name.
Usermaven accepts the following parameters. Parameters with a (\*) are required.
Parameter
Value
key \* / data-key
Required. API key.
tracking_host / data-tracking-host
If no specific setting is provided, Usermaven will make its best effort to identify the requirements automatically. For HTML snippets, the script location host will be taken into account. As for npm packages, t.usermaven.com is the standard host.
autocapture / data-autocapture
Automatically capture frontend events i.e. button clicks, form submission etc. Accepted values are true or false.
cookie_name / data-cookie-name
Name of tracking cookie (__eventn_id_{API_KEY} by default)
cookie_domain / data-cookie-domain
Domain of the tracking cookie (by default this is location.hostname with any www. subdomain removed)
randomize_url / data-randomize-url
If set to true, Usermaven will emit events to a dynamic endpoint, which prevents the blocking of advertisements.
ip_policy / data-ip-policy
['keep', 'comply', 'strict'] values are supported. keep value is default. keep – Usermaven extracts client IP address and stores it in every analytics event in source_ip field. strict – Usermaven replaces the last octet in the client IP address with 1 on the backend side, e.g. 10.10.10.10 → 10.10.10.1. comply – Usermaven detects the client's country with MaxMind (if MaxMind isn't provided, behavior is like strict mode). If the client is from the EU or UK, the behavior is in strict mode; otherwise it follows keep mode.
cookie_policy / data-cookie-policy
['keep', 'comply', 'strict'] values are supported. keep value is default. keep – Usermaven writes identification cookies and recognizes users with them. strict – Usermaven doesn't write any cookies (including identification cookies and persistent properties). Instead of cookies, Usermaven uses fingerprinting (hash(client ip + user agent) function). comply – See full documentation for details.