Reference
Parameters Reference

Parameters reference

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.


Parameter
(data-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 last octet in client IP address with '1' on the backend side. like 10.10.10.10 -> 10.10.10.1

comply - Usermaven detects the client's country with MaxMind (if MaxMind isn't provided, the behavior will be like in strict mode). If the client is from the EU or UK, the behavior is in strict mode; otherwise, it follows keep mode. In comply mode, Usermaven additionally masks the client's IP address on the server side. For clients from the EU region, the IP address is masked, while for clients from the non-EU region, the full IP address is stored.


cookie_policy
(data-cookie-policy)



['keep', 'comply', 'strict'] values are supported. keep value is default. keep - Usermaven writes identification cookies and recognizes users with it.


strict - Usermaven doesn't write any cookies (including identification cookies and persistent properties). Instead of cookies, Usermaven will use fingerprinting ( hash(client ip + user agent) function).


comply - Usermaven detects the client's country with MaxMind (if MaxMind isn't provided, the behavior will be like in strict mode). If the client is from the EU or UK, the behavior is in strict mode; otherwise, it follows keep mode. In comply mode, Usermaven additionally masks the client's IP address on the server side. For clients from the EU region, the IP address is masked, while for clients from the non-EU region, the full IP address is stored.


privacy_policy
(data-privacy-policy)



This parameter is just shortcut for strict configuration of cookie_policy and ip_policy. If set to strict value, cookie_policy and ip_policy will be set strict.


force_use_fetch
(data-force-use-fetch)


This parameter forces SDK to use the fetch implementation (custom or default) even in browser


exclude
(data-exclude)


You can implement page-specific exclusions by utilizing the data-exclude attribute. To prevent particular pages from being monitored, follow this method: i.e data-exclude="/embed/*"


In the given example, any pages beginning with the "/embed/" path will be omitted from tracking.

custom_headers


(Not available as data- parameter in embedded environment; available only in npm lib)

This parameter adds custom headers to each request. Can be either a static object (Record<string, string>) or a function that returns an object