Pages

To integrate the Frosmo Platform with your site, you must add two <script> elements to every page on your site. This is the only change you need to make on your site to use the Frosmo Platform. 

The first script element loads the Frosmo Core library (frosmo.easy.js ). The second element loads the Frosmo custom script (<site_origin>.js) that contains the configurations specific to your site, such as modifications, segmentation rules, placements, and predefined custom actions.

The scripts are separated so that modifications can be pushed faster to your site without having to load the entire Frosmo JavaScript library every time.

For information about script hosting and delivery, see Technical overview.

To get the Frosmo Platform up and running on your site:

  1. Plan your site setup.
  2. If necessary, create additional sites in the Frosmo Control Panel.
  3. Get the script elements from the Control Panel.
  4. Place the script elements on your site.
  5. Check your site modules.
  6. If necessary, set up single-page application support.

Planning your site setup

In the Frosmo Platform, a site represents an actual website of a company. Each site has its own custom script. When you create and manage a site in the Control Panel, you're actually creating and managing a custom script.  Each site also has its own dedicated set of data and statistics tracked by the Frosmo Platform on the website (such as product data, modification statistics, and conversions statistics).

Figure: Sites in the Frosmo Platform

Whether you need to create one or more sites in the Frosmo Platform is ultimately a question of whether you can manage your domains and subdomains, including their usage data and statistics, as a single whole.  As a rule of thumb, create as few separate sites as possible in the Frosmo Platform. 

For example, if your company has several nearly identical websites, such as localized versions of the same website, and if you don't need to keep their data and statistics separate, create a single site in the Frosmo Platform and use its custom script on all the websites. If, on the other hand, you do need to keep the data and statistics separate, create dedicated sites and use the corresponding custom script on each website.

To track your visitors across protocols and domains, use a shared context. A shared context allows the browser to store visitor data once and share it across pages in different domains and using different protocols. This allows visitor to be treated as a single user within your service. You can enable shared context for your site in the Frosmo Control Panel site settings when you create a new site.

If you're not sure how many sites to create or how to share the same custom script, contact your Frosmo representative.  For more information about different site setups, see Creating and managing sites.

Creating sites

Frosmo always creates the first site for you in the Control Panel. If you're a Professional Services customer, your Frosmo team creates any additional sites for you. If you're Platform customer, you create the additional sites by yourself.

To create a site:

  1. In the Control Panel, click your user name, and select Company Settings.

  2. In the companies and sites list, find the company for which you want to create the site.
  3. Click the quick menu button for the company, and select Create site.

  4. Define the basic site settings:

    • Site URL: Enter the complete URL for the site (for example, https://docs.company.com/). You can also edit the URL after you've created the site. As a rule, this URL also determines the site name ("origin") used to identify the site in the site's custom script and in the Frosmo back end (for example, docs_company_com).
    • Shared context: Enable this feature only if your website contains multiple domains or uses multiple protocols, and if you want to track visitors across the different domains and/or protocols. To enable this feature, click Enable. You cannot enable or disable this feature after you've created the site. For more information about this feature, see Data collection and storage.
    • Frosmo status: Toggle the Frosmo Platform on or off for the site by clicking Frosmo on / Frosmo off. You can also switch the Frosmo Platform on or off after you've created the site.

  5. Select Conversion settings, and select the currency used to measure revenue on the site. You can also change the currency after you've created the site.

  6. When you're done, click Create.

For more information about creating a new site, see Creating and managing sites.

Getting your script elements

You can get your site-specific <script> elements from the Frosmo Control Panel.

You may have agreed to get the <script> element code delivered to you by your Frosmo representative. In that case, follow the instructions provided by them.

To get the script elements for a site:

  1. In the Control Panel, click your user name, and select Company Settings.

    Accessing company settings

  2. In the companies and sites list, find the site whose script elements you want to get. To filter the list, start typing the company or site name in the search field.
  3. Click the quick menu button for the site, and select View script elements.

  4. Copy the code for the script elements.

    Getting the script elements for a site

If your company has multiple sites, repeat the above steps for each site.

Placing the script elements on your site

You have the following options for adding the Frosmo scripts to a web page:

If your CMS supports global rules or templates, you can also use them to easily add the Frosmo scripts in the <head> element of each page. In this case, the scripts are loaded when the page content is rendered.

If your company has multiple sites, add the scripts to each site.

Adding the scripts directly to the page code

To get the most out of the Frosmo Platform, add the Frosmo scripts directly to the <head> element of each page on your site. If you have a larger site and need to separately update a lot of pages, use a batch script to automate and speed up the process.

By default, the scripts are loaded synchronously. Synchronous loading means that the browser waits until the script has been completely loaded before processing the rest of the HTML code on the page.

Synchronous scripts placed above the visible content of the HTML document have a greater chance of being executed before the visible content is displayed in the browser. Using synchronous scripts can therefore minimize flickering when displaying content modifications.

There are some specific cases in which it makes sense to place the scripts in the <body> element of the page, or to load them asynchronously. Asynchronous loading means that some of the scripts implemented on the web page can be loaded simultaneously. For example, when your site has gone through major structural or technical changes, you may want to make sure the pages on your site are loaded properly before loading the Frosmo scripts. However, in most cases, you can work around this by setting event handlers to load the Frosmo scripts at the appropriate moment.

To load the scripts asynchronously, add the async=true attribute to the script elements.

Using a tag manager

Using a tag manager normally causes some delay in loading the Frosmo scripts as the native scripts of the site are often loaded first. Some tag managers, such as Google Tag Manager, do not allow you to place the scripts in the <head> element. Some tag managers also load scripts asynchronously, which makes the Frosmo scripts behave asynchronously regardless of their type. 

If the tag manager is set to delay script loading or loads several other scripts before the Frosmo scripts, the page loading speed may suffer. Therefore, even when using a tag manager, make sure that the Frosmo scripts are loaded as early as possible, preferably right after the site's native scripts.

Checking your site modules

A site module is a feature, such as selective profiling or the data layer, that is either active or inactive on a site. You can view information about the modules, including whether they are currently active. 

If you need to activate specific modules for the site, contact your Frosmo representative. By default, the only module that is active for a new site is IE10 support. 

To view site module information:

  1. In the Control Panel, click your user name, and select Company Settings.

    Accessing company settings

  2. In the companies and sites list, find the site whose module information you want to view.
  3. Click the quick menu button for the site, and select View modules.

    Viewing site modules

    The modules view lists all the modules supported by the Frosmo Platform.

For more information about site modules, see Creating and managing sites.

Supporting single-page applications

The Frosmo Platform normally runs the custom script for a site when a page on the site is loaded. However, for single-page applications, the custom script must run whenever the URL changes, as there are no page loads. 

Sites can be built in other ways that require running the custom script based on URL changes. For example, if your site has an infinite scroll and you want to display new elements built with Frosmo without reloading the page,  the Frosmo Platform must be set up to listen to URL changes.

Currently you cannot set up single-page application support by yourself. In case your site needs support for single-page applications, or is built in a way that the Frosmo Platform custom script must be run based on URL changes, contact your Frosmo representative.

  • No labels