Parsers (Data Parsing Engine)
The data parsing engine is a tool that allows you to automatically parse data from various sources into Personizely's website data object or visitor's profile in Personizely. Every parser can parse a single value to one of the possible destinations.
Every parser has a destination (and destination key) and a source (and a source key).
The source defines where should the data be parsed from, there are 5 sources:
- Browser Local Storage - takes the value from the visitor's browser local storage and is the equivalent of calling localStorage.getItem(key)
- URL Query String - takes the value from the visitor's URL address. Example: https://site.com?name=Jim, where Jim can be parsed by using name as the source key.
- Cookies - takes the value from the visitor's cookies where the cookie name is the source key.
- CSS Selector - parses the inner text from an element from the page where the source key is a valid CSS selector used to find that element. Is the equivalent of calling document.querySelector(key).innerText.
- JS Variable - parses the value from a JS variable that should be available in the global context where the source key is the variable name (can also use don notation for accessing deeper nested values).
The destination defines where the parsed data should be saved. There are 2 destinations:
- Data - website data - this data only lives for the duration of a session and should generally include information about the current session or website.
- Visitor - the visitor's profile - this data is saved into the visitor's profile inside the Personizely database and is persistent between sessions.