Depending on the architecture of your website, the project settings may differ. If your site is built on AJAX technology, different sections of the site are located on different subdomains, and in some other cases you need to tweak the settings.
How to adjust the settings:
- Log in to the site segmentstream.com
- Click on the “Settings” link in the upper right corner of the window.
- Adjust the settings according to the documentation below
- Publish the project.
Viewed Page event is the base event. It is necessary for the operation of most third-party systems. Various data from the
digitalData object is sent to third-party systems along with the Viewed Page event:
digitalData.listing.categoryId and many others.
Viewed Pageevent must be added to the array
digitalData.eventsonly after the data of the
digitalDataobject has been fully populated.
By default, SegmentStream automatically adds the
Viewed Page event to the
digitalData.events array when the
segmentstream.js library is loaded. This happens every time a page loads.
If you add the
Viewed Page event to the
digitalData.events array yourself from the site code, do this only after filling the digitalData object with all the variables. In this case, turn off the “Automatic send Viewed Page event” option using the switch.
SegmentStream allows you to create new variables based on the events and variables of the
digitalData object and save them for a certain period. For example: you need to give google analytics the number of times product pages are viewed before a transaction is completed. For more information about saving variables, see Variables.
By default, the value of any variable is stored in the [LocalStorage] (https://www.w3schools.com/html/html5_webstorage.asp) of the visitor’s browser as a string. LocalStorage is supported by all modern browsers. Unlike Cookie, LocalStorage is a more secure storage, holds up to 5 MB, and information is never sent to the server.
However, LocalStorage stores information within the same domain. This means that you can not access information from the subdomain pages.
If different sections of your site are located on subdomains - use Cookie instead of LocalStorage
For the domain to set the cookie, specify the top-level domain. For example, your online store is located at https://shop.ru, but the basket is located at https://cart.shop.ru. To ensure that the information stored on the pages of the goods cards is available from the shopping cart pages, you must use the cookie with the domain shop.ru
Cookies store only 4kb. Pay attention to this when saving large arrays or strings.
SegmentStream has a built-in event
Session Started. This event is automatically added to the array
digitalData.events if the given user has passed more than the specified time interval from the moment of any other event. By default, this length of time (Session Length) is one hour or 3600 seconds.
- A user visits the website for the first time. Simultaneously with the first event,
Viewed PageSegmentStream will add the
Session Startedevent to the array
- The interacted with the website, left the browser tab open and left for 2 hours. The user returned to the site and clicked on a banner or moved to another page. At this point, the event
Session Startedwill be automatically added to the array
You may need this event if you want to nullify or overwrite the value of a variable in the digitalData object when the new session starts.
We recommend setting the same session length in both Google Analytics and SegmentStream.
If you use a block with a banner slider on the site, we recommend setting the maximum width of the window of your site in the field of settings. This setting will help to correctly setup the events of banner impressions.
SegmentStream has a built-in integration error tracking module. This module displays information about all the data sent to third-party systems in the developer console. If you enable the tracking of validation errors, whenever an integration error occurs with any of the site visitors, SegmentStream will automatically add this event to the array
digitalData.events. Now this event can be sent to any statistics system for further analysis of the causes of the error.
If you have set up the Google Analytics integration, you can find information about validation errors in the event reports.
Example of a report setup in the Google Analytics interface