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.
cookie_name
<br />(<span style={{ whiteSpace: "nowrap" }}>data-cookie-name</span>)
</td>
<td>
<br/>
Name of tracking cookie (`__eventn_id_{API_KEY}` by
default)
<br/>
</td>
</tr>
<tr className="nx-border-b nx-border-neutral-400 dark:nx-border-neutral-800">
<td>
cookie_domain
<br />(<span style={{ whiteSpace: "nowrap" }}>data-cookie-domain</span>)
</td>
<td>
<br/>
Domain of the tracking cookie (by default this is{" "}
`location.hostname` with any{" "}
`www.` subdomain removed)
<br/>
</td>
</tr>
<tr className="nx-border-b nx-border-neutral-400 dark:nx-border-neutral-800">
<td>
randomize_url
<br />(<span style={{ whiteSpace: "nowrap" }}>data-randomize-url</span>)
</td>
<td>
<br/>
If set to true, Usermaven will emit events to a dynamic endpoint, which prevents the blocking of advertisements.
<br/>
</td>
</tr>
<tr className="nx-border-b nx-border-neutral-400 dark:nx-border-neutral-800">
<td>
ip_policy
<br />(<span style={{ whiteSpace: "nowrap" }}>data-ip-policy</span>)
</td>
<td>
<br/>
`['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.
<br/>
</td>
</tr>
<tr className="nx-border-b nx-border-neutral-400 dark:nx-border-neutral-800">
<td>
cookie_policy
<br />(<span style={{ whiteSpace: "nowrap" }}>data-cookie-policy</span>)
<br/>
</td>
<td>
<br/>
`['keep', 'comply', 'strict']` values are
supported. `keep` value is default.
`keep` - Usermaven writes identification cookies and
recognizes users with it.
<br/>
`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).
<br/>
`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.
<br/>
</td>
</tr>
<tr className="nx-border-b nx-border-neutral-400 dark:nx-border-neutral-800">
<td>
privacy_policy
<br />(<span style={{ whiteSpace: "nowrap" }}>data-privacy-policy</span>)
<br/>
</td>
<td>
<br/>
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`.
<br/>
</td>
</tr>
<tr className="nx-border-b nx-border-neutral-400 dark:nx-border-neutral-800">
<td>
force_use_fetch
<br />(<span style={{ whiteSpace: "nowrap" }}>data-force-use-fetch</span>)
</td>
<td>
<br/>
This parameter forces SDK to use the fetch implementation (custom or default) even in browser
<br/>
</td>
</tr>
<tr className="nx-border-b nx-border-neutral-400 dark:nx-border-neutral-800">
<td>
exclude
<br />(<span style={{ whiteSpace: "nowrap" }}>data-exclude</span>)
</td>
<td>
<br/>
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/*"`
<br/>
In the given example, any pages beginning with the "/embed/" path will be omitted from tracking.
</td>
</tr>
<tr>
<td>
custom_headers
</td>
<td>
<br/>
*(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
<br/>
</td>
</tr>
</tbody>
Was this article helpful?