Rayn JS Functionalities and Operations FAQ
Necessity of Rayn JS
Question: Why do I need Rayn JS?
Answer: Rayn JS simplifies the integration of Rayn for Web on your website. It manages consent handling, acquisition of contextual categories, user behavior measurement, cohort creation, local caching, and ensures instant data access.
Consent Check Functionality
Question: How does Rayn JS handle consent checks?
Answer: Before performing any other action Rayn JS will check for a CMP object to ascertain which legislation is applicable. After detecting the appropriate legislation, Rayn JS will attempt to establish a legal basis for accessing, storing and processing data on a user's device.
EU
Within the EU, Rayn relies on the IAB TCF framework. Rayn JS will check for the CMP and will wait until consent has been established for Vendor ID 1220 and all it's required purposes. If no consent is present then, Rayn JS will not generate a userId and all requests from Rayn JS will be aborted.
USA State Specific
In case Rayn JS finds an IAB specified opt-out signal in the CMP object, the library will not generate a userId and all requests from Rayn JS will be aborted.
Outside EU
If no IAB CMP object is present then Rayn JS will initialise and proceed with data collection.
Browser provided signals
Some browsers can pass along privacy signals like DNT (Do Not Track) and GPC (Global Privacy Control). Rayn JS relies on the CMP to read these signals and adjust the consent state.
Logging burden of proof
To ensure that Rayn has a legal basis for data collection the ConsentString is checked and passed along in every request for logging.
Check if Rayn has consent in TCF
Question: How can I check whether Rayn has consent in a TCF CMP.
Answer: Check whether Rayn is mentioned in the CMP as a vendor. Alternatively you can check the TC string. To check the TC string:
Open the browser console.
Give consent for all requested vendors and purposes in the CMP by clicking "Accept all", "Agree to all", etc..
Pass the getConsentData API in the console.
__tcfapi('getTCData', 2, (tcData, success) => {console.log(tcData)});
Copy the TC-string and decode it in http://iabtcf.com/
The vendor IDs, purposes should show consent for vendor 1220
What happens if Rayn JS does not have consent?
In case Rayn JS does not have TCF consent, then it will switch to "no consent mode". In no consent mode it will not access local storage or make requests to the Rayn API. Instead it will return the categories from the Audience Models and Default content categories. Make sure that you have configured Air Intelligence and apply audience models that show a decent reflection of your general audience.
Content Contextualization Process
Question: How does Rayn JS manage content to context transformation?
Answer: Upon loading Rayn JS
obtains website content and performs a checksum to validate whether content has changed. if content changed or there are no categories in the cache then content is sent to Rayn context engine for processing. Once processed the categories are stored in cache.
checks whether contextual categories are available in local storage for the given URL.
checks for existing contextual categories in local storage. If absent, it checks the context cache or processes the website content to generate categories.
utilizes default categories as placeholders until the context cache updates if no categories are present.
Read more on the Rayn JS javascript API.
User Behavior Analysis and Cohort Formation
Question: How does Rayn JS analyze user behavior and form cohorts?
Answer: Rayn JS assigns a unique Rayn User ID per website domain to track user behavior without enabling cross-site tracking. Usage scope of the Rayn User ID is limited to a website domain. User actions are stored in local storage, and when behaviors align with predefined conditions, users are grouped into cohorts. Cohorts represent specific audience segments, and user cohort IDs are encoded in the CohortString. This data is periodically transferred to and stored in the Rayn cohort database.
What user data is Rayn using for behaviour measurement
User data that is logged:
Name | Example | Description |
Timestamp | 1693917661650 | Time when the data was logged. |
Rayn-user-id | f64c6681-dc5d-4125-9868-a70f16f6f35e | Randomly assigned user id. (Usage scope of the Rayn User ID is limited to a website domain.) |
User agent | Mozilla/5.0 (Linux; Android 13; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36 | Device type, browser type, Operating System |
Pages visited | The URL's of the pages that the user visited within the domain. | |
Number of pages visited | 4 | Sum of pages that the user visited. |
Time spent in Seconds | 2 | The time spent on the individual URL's in seconds. |
Integrating Rayn JS with Google Ad Manager and Prebid
Question: How does Rayn JS integrate with ad platforms like Google Ad Manager and Prebid?
Answer: Rayn JS integrates with common ad platforms by injecting contextual categories and cohorts as key-value pairs. For Google Ad Manager, these are added into the Google Publisher Tag. Detailed information on the Google Ad Manager (GAM) and Prebid integrations are available in the respective sections of our knowledgebase. More information on the GAM integration can be found here. Read more on the prebid integration here.
Acquiring a Rayn JS Tag
Question: How do I obtain a Rayn JS Tag?
Answer: The Rayn JS Tag can be retrieved from the management console. Detailed guidelines on configuring and obtaining Rayn JS tags are provided in the relevant documentation. Read more on how to configure and obtain Rayn JS tags.
Installing Rayn JS
Question: How do I install Rayn JS on my site?
Answer: Install the Rayn JS wrapper by placing it in the
<head>
section of the pages where Rayn is to be used. Comprehensive installation instructions are available in our knowledgebase. More information on installing Rayn JS can be found here.
Loading Rayn JS via Tag Managers
Question: Can I load Rayn JS using a tag manager?
Answer: Yes, Rayn JS can be loaded through a tag management solution or integration script. However, for immediate data activation, it's recommended to load Rayn JS as early as possible.
Impact of Rayn JS on Page Speed
Question: Will Rayn JS slow down my website?
Answer: Rayn JS is designed to load asynchronously, ensuring that it does not impact your page's loading speed.
Performance and Processing Time
Question: How long does it take for Rayn JS to process and provide contextual categories?
Answer:
Retrieving contextual categories from the context cache typically occurs within 50ms, though this can vary based on CDN edge cache and proximity to the edge location.
Sending website content for new URLs generally takes about 5ms, depending on system speed and content size.
The context engine processes new content in order, usually within an hour, but this can vary based on the volume of new content being submitted.
Library Size of Rayn JS
Question: What is the size of the Rayn JS library?
Answer: The compressed size of Rayn JS is approximately 21.2kb. Uncompressed ~61.5kb.
Where does Rayn JS store user data?
Local Storage
Rayn JS uses the following keys in local storage:
Key | Example | Description |
rayn | 䤣˭佴ࠝ弐稀ᾝघ婘☄©榡᳜竏䝨䧾䳴┇厅⎨ჭ㈯䤰妄捁⡱叀༡吣ሠ¨4⪠$欥ѡ戠Y⢧ᠮ℠ʳ硘... | Encoded string containing all rayn data. |
rayn-segtax | { "4": { "3": [ "625", "775", "648", "667", "1633" ] } } | Rayn context categories, cohorts and personas unencoded for the prebid adapter. |
The following data is stored in local storage:
Name | Example | Description |
rayn-cohort-string | ZGVtby1jb25maWc7MTY5Mzg3M... | Encoded string containing all associated cohorts for this user. |
rayn-personas | 1f4f5w | Persona id's associated with this user. |
rayn-user-id | f64c6681-dc5d-4125-9868-a70f16f6f35e | Randomly assigned user id. (Usage scope of the Rayn User ID is limited to a website domain.) |
rayn-page-info | 1343633982: {url: "https://demo.rayn.io/op-ed", timeSpentInSec: 0,…}
categories: [{taxonomy_keyword: "Single Life Family and Relationships Single Life ", taxonomy_id: "200",…},…]
storedAtInMs: 1693917661650
timeSpentInSec: 0
url: "https://demo.rayn.io/op-ed" | Pages visited the user visited within the domain, the contextual category of the pages and the time spent o the pages in seconds. |
rayn-no-pages-visited | 4 | Sum of pages that the user visited. |
Location of Data Storage
Question: Where is the data stored by Rayn JS?
Answer: Data handled by Rayn JS is securely stored in the AWS cloud, with the infrastructure located in Europe.
Duration of Data Retention
Question: How long does Rayn JS store user data
Answer:
Local Storage
The retention period of user data in LocalStorage is influenced by browser-specific policies. For instance, Safari automatically clears LocalStorage every 7 days. Additionally, the data is removed if a user manually clears their LocalStorage. It's important to note that LocalStorage does not have a set expiration time by default.
Server Side Storage
On the server side, Rayn JS retains user data for a period of 24 hours. After this duration, the data undergoes aggregation, and individual user IDs are removed as part of our data management and privacy compliance processes.