Documentation / Product / Features / Lytics JavaScript Tag / Using Version 3

Installation & Configuration

In most cases, installing the Lytics JavaScript Tag version 3 is as easy as copying and pasting a few lines of code to your source code or Tag Manager. Full instructions, as well as the tag itself are available from the web app.

Configuration Options

Version 3 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.

KeyTypeExampleDescription
url requiredstring//c.lytics.ioURL endpoint to send the collection request.
cid requiredstring{YOUR_LYTICS_CID}Account ID which can be found in your dashboard Account Settings.
loadid optionalbooleantrueUsed when identifying users across domains.
blocked optionalbooleantrueUsed to get a user’s most updated audience membership and profile data before sending data to Lytics.
stream optionalstringgetlyticsName of the stream your data will be sent to.
sessecs optionalinteger1800Length 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.
serializer optionalstringdefaultDetermines which serializer the JavaScript tag should use when sending data to Lytics.

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. The loadid flag allows Lytics to use the third-party cookie if available, thus pulling cross-domain behavior into a single, unified user profile.
  • blocked: This is set to false by default. Only installations highly dependent on reducing latency as much as possible should use true.
  • 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.
  • serializer: This is set to default by default. During migration from v2 to v3 you may opt to use the legacy serializer which serializes data passed to Lytics in the same way as version 2 of the tag. That is, it will ignore the "grandparent" namespace on deeply nested variable names. You should only opt to use the legacy serializer if the data you're passing is deeply nested and you were previously using v2 of the Lytics JavaScript tag.

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.

jstag.init({
  src: ...,
  loadid: true
});