Gravity Field Scripts Workflow
Last updated
Was this helpful?
Last updated
Was this helpful?
Core.js - core library.
Dynamic.js - stores information about campaigns, evaluators, strategies, and settings. It can be called from the core, where it will be an asynchronous load, or it can be embedded in the code and loaded synchronously through .
In the case of an asynchronous load, the website's loading speed is higher; however, there is also a higher probability of flickering.
In the case of a synchronous load, the probability of flickering is lower, but the site's loading speed is impacted.
A section is created in the admin panel of the personalization platform. When creating a section, its ID is generated along with an empty dynamic.js
file.
Code snippet is deployed to the site code:
The snippet includes the core.js
script, which is the core of the application and dynamically loads the required dynamic.js -
a separate script which is created for each section and contains JSON data with campaigns and settings specific to that section.
There is an option for synchronous script loading - Sync Load. It is used in cases when you need minimalized campaign flickering.
Core.js + dynamic.js sends a request to evs-01.gravityfield.ai to retrieve user data. This request is necessary to obtain a user's data and is created on every page load.
When the user interacts with the website, predefined events configured during integration will be sent. 3. Events
Dns-prefetch tags should be placed before the script to reduce DNS response time.
Preconnect tags allow the browser to set up a connection even before sending an HTTP request to the server. This helps to avoid delays and saves time for users. Some browsers (Internet Explorer, Safari) do not support preconnect tags and will ignore them.
These four tags should be included on every page of the website:
Two domains are used for the operation of the personalization platform:
All scripts are executed only after all user data has been received. In the future, it may be possible to implement a scenario where campaigns are launched step by step depending on the reception of the data required for their operation.
The dynamic.js script is updated with the updates of its components:
Campaigns
Audiences
Strategies etc.
The core.js script is updated with releases of new versions of platform.
Scripts caching:
dynamic.js - 5 minutes
core.js - 1 hour
The personalization platform uses 4 cookie files:
_slid
user ID
.yoursite.net
6343ff0e728f987d7c02325a
365 days
_slid_server
the same user ID in the first-party cookie
.yoursite.net
6343ff0e728f987d7c02325a
365 days
_slsession
session ID
.yoursite.net
C2A1D08D-BA49-43CF-9BB3-047030084FCF
365 days
_slfreq
campaign frequency data
.yoursite.net
6347f312d9062ed0380b52dc%3A6347f38c9a3f3b9e90027775%3A1667310093
365 days
— server queries
— CDN