Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from this space and version 13.0

This example shows you how to use a trigger to segment visitors based on the type of device they use (desktop, tablet, or mobile). Knowing the device type your visitors are using is crucial to be able to optimize the layout and content for different screen sizes.


To create the trigger:

  1. In the Frosmo Control Panel, select select Triggers.
  2. Click Create trigger.
  3. Define the following settings:

    • Name: Enter
    the trigger name as
    • "[Device
    • type] Desktop".
    • Evaluation point
    , select 
    • : Select DOM ready.
    • Rules: Click Add new rule, select JavaScript code, and set the

    • following rule:


      The value of the

      Code Block
    • JavaScript function is exactly true.

      This means that when all HTML elements have been loaded on the page, the JavaScript functions checks whether the visitor is using a desktop device. If so, the function returns "true", and the trigger is fired.

    Creating the triggerImage Removed

    When you're done, click 

    Defining the trigger settingsImage Added

  4. Click Save.

Creating the segment

To create a segment for visitors who use a desktop device:

  1. In the Frosmo Control Panel, select select Data Management > Segmentation > Segments.
  2. Click Create segment.
  3. Define the segmentation rules:

    1. Click Add new rule, select Trigger, and set the

    1. following rule:


      The visitor has triggered [Device

    1. type] Desktop more than equal to 1 times, with each trigger event counted.

      This means that in order to get segmented, the visitor must browse the site using a desktop device at least once. The trigger is evaluated on each page load.

    2. Set the time limit based on the start and end date of your modification. The default time limit is 14 days.

    Configuring the segmentation ruleImage RemovedDefining the segmentation rulesImage Added

  4. Select Description, and enter the segment name as "Using desktop device" . You can also enter a description to better remember what as the segment is aboutname.
  5. When you're done, click Click Save.

You have now completed the example. Visitors that Visitors that browse the site using a desktop device will now be segmented.

You're done with this example!