Data Collector

Analytics data collector JavaScript

Simple JavaScript snippet collects visitors' behavior on the website.

Inserting a JavaScript snippet into pages
Ideally, place it as high as possible in the HTML structure to improve data loading speed.

<html>
  <head>
   <link rel="preconnect" href="https://static.perselio.com">
   <link rel="dns-prefetch" href="https://static.perselio.com">
   <script src="https://static.perselio.com/versions/v3/interactions-<CODE>.js" async></script>
   <!-- other scripts go here -->
  </head>
</html>
Tip

TENANT is a specific code that you receive during account registration

Speed up script loading with resource hints

Place <link rel="preconnect"> and <link rel="dns-prefetch"> for https://static.perselio.com before the script tag. preconnect establishes the DNS lookup + TCP + TLS handshake early; dns-prefetch acts as a fallback for older browsers that don't support preconnect. Both hints must appear before the

The script is optimized

  • Asynchronous loading does not slow down website performance
  • Low memory footprint
  • Script penetration testing performed
  • Option to offload script loading under specific conditions (please contact the team)

Alternative deployment can be done via Google Tag Manager. This solution is not recommended as it requires non-trivial time to wait for GTM to load, which leads to slow component display.



📘

The collector reads product identifiers straight from your pages. See Identifying Products on Your Site for what it looks for and what it needs from your templates.

This script serves several crucial functions aimed at enhancing the user experience on the webpage:

  1. Collecting visitor interaction data with the product catalog:
    The script actively monitors user behavior on the page, tracking movements and
    interactions with the product catalog. These insights are then utilized to
    create a comprehensive picture of how users navigate through the product
    offerings.
  2. Rendering embedding widgets in selected areas:
    The script has the capability to dynamically render widgets in
    specific locations on the webpage.
  3. AB testing of the page with/without widgets:
    The script enables A/B testing on the webpage, where the version with the activated
    widgets can be experimentally compared with the version without
    them.
🚧

The Data Collector stores the anonymous visitor ID in the _sa cookie and the visitor's A/B test group in _saexp. If your consent manager (for example Cookiebot) deletes them, visitors lose their history and switch between A/B test groups, which breaks personalization, attribution, and A/B test results. See Cookies for how to keep them.

Overall, the script represents a tool for personalization and
optimization of the user environment on the client's webpage, potentially
leading to increased user engagement and higher conversion rates.


Did this page help you?