Installation & Configuration
In most cases, installing the Lytics JavaScript tag version 2 is as easy as copying and pasting a few lines of code to your source or Tag Manager. Full instructions, as well as the tag itself are available from the web app.
Configuration Options
Version 2 of our JavaScript tag comes configured out-of-the-box with coverage ready for most use cases. That said, there are a variety of configuration options available to support custom or in-depth use cases. Please find all available configuration options below with additional details listed after the table. You can see more implementation examples in the app tag installation instructions.
Key | Type | Example | Description |
---|---|---|---|
url required | string | //c.lytics.io | URL endpoint to send the collection request. |
cid required | string | {YOUR_LYTICS_CID} | Account ID which can be found in your dashboard Account Settings. |
loadid optional | boolean | true | Used when identifying users across domains. |
blockload optional | boolean | true | Used to get a user’s most updated audience membership and profile data before sending data to Lytics. |
stream optional | string | getlytics | Name of the stream your data will be sent to. |
sessecs optional | integer | 1800 | Length of time between requests necessary before starting a new session. 1800 by default. |
qsargs optional | []string | ['name','status'] | An array of query parameters that should always be pulled in when collecting data. |
Additional details
url
: The generated URL should never be changed as it will prevent your data from being sent to Lytics.cid
: When using the tag generated from your Lytics account, your ID will be included and should not be altered.loadid
: By default, Lytics will store a first and third-party cookie that represents a user. Theloadid
flag allows Lytics to use the third-party cookie if available, thus pulling cross-domain behavior into a single, unified user profile. Lytics JStag v 1.31 and v 2.0.0 have a dependency on jQuery to access third-party cookies. If jQuery is not available, the first-party will be used.blockload
: This is set totrue
by default. Only installations highly dependent on reducing latency as much as possible should usefalse
.stream
: When collecting data across various domains, it is common to use a custom stream for each domain, which will require proper LQL in place to surface the collected data as user fields. Consult customer support for more details.
Custom Configuration Example
When calling jstag.init
you will pass in the tag configuration. You can take advantage of the above configuration options by adding them to your configuration. For example, if you want to leverage third-party cookies to enhance your brand’s ability to resolve identities between owned properties, add loadid
to the configuration.
window.jstag.init({
cid:...,
url:...,
loadid: true
})