Skip to content

Nudges

Available variables

The following variables can be used in nudge expressions:

Visitor variables:

visitor.inserted_at
visitor.returning
visitor.ip
visitor.timezone
visitor.locale
visitor.reverse_ip

visitor.geo_ip.city.name
visitor.geo_ip.city.geoname_id
visitor.geo_ip.country.geoname_id
visitor.geo_ip.country.is_in_european_union
visitor.geo_ip.country.iso_code
visitor.geo_ip.country.name
visitor.geo_ip.location.accuracy_radius
visitor.geo_ip.location.latitude
visitor.geo_ip.location.longitude
visitor.geo_ip.location.metro_code
visitor.geo_ip.location.time_zone

visitor.user_agent.raw
visitor.user_agent.device.brand
visitor.user_agent.device.family
visitor.user_agent.device.model
visitor.user_agent.device_os
visitor.user_agent.displayHeight
visitor.user_agent.displayWidth
visitor.user_agent.family
visitor.user_agent.id
visitor.user_agent.inputDevices
visitor.user_agent.is_crawler
visitor.user_agent.is_desktop
visitor.user_agent.is_tablet
visitor.user_agent.is_phone
visitor.user_agent.is_wireless_device
visitor.user_agent.model
visitor.user_agent.os.family
visitor.user_agent.os.version.major
visitor.user_agent.os.version.minor
visitor.user_agent.os.version.patch
visitor.user_agent.os.version.patch_minor
visitor.user_agent.parentId
visitor.user_agent.vendor
visitor.user_agent.version.major
visitor.user_agent.version.minor
visitor.user_agent.version.patch
visitor.user_agent.version.patch_minor

Page variables:

page.scroll
page.title
page.url
page.fragment
page.host
page.path
page.scheme
page.query
page.params.*
page.referrer.url
page.referrer.fragment
page.referrer.host
page.referrer.path
page.referrer.scheme
page.referrer.query
page.referrer.params.*

Others:

time_on_page

Example user agent dumps

iPhone:

%{
  "ajax_support_javascript" => true,
  "device" => %{"brand" => "Apple", "family" => "iPhone", "model" => "iPhone"},
  "device_os" => "iPhone OS",
  "displayHeight" => 480,
  "displayWidth" => 320,
  "family" => "Mobile Safari",
  "id" => "iPhone",
  "inputDevices" => "touchscreen",
  "is_crawler" => false,
  "is_desktop" => false,
  "is_phone" => true,
  "is_tablet" => false,
  "is_wireless_device" => true,
  "model" => "iPhone",
  "os" => %{
    "family" => "iOS",
    "version" => %{
      "major" => "11",
      "minor" => "4",
      "patch" => "1",
      "patch_minor" => nil
    }
  },
  "parentId" => "genericApple",
  "raw" => "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1",
  "vendor" => "Apple",
  "version" => %{
    "major" => "11",
    "minor" => "0",
    "patch" => nil,
    "patch_minor" => nil
  }
}

Android:

OnePlus A9

%{
  "ajax_support_javascript" => true,
  "device" => %{
    "brand" => "OnePlus",
    "family" => "OnePlus ONEPLUS A5000",
    "model" => "ONEPLUS A5000"
  },
  "device_os" => "-",
  "displayHeight" => 480,
  "displayWidth" => 320,
  "family" => "Chrome Mobile WebView",
  "id" => "genericTouchPhone",
  "inputDevices" => "touchscreen",
  "is_crawler" => false,
  "is_desktop" => false,
  "is_phone" => true,
  "is_tablet" => false,
  "is_wireless_device" => true,
  "model" => "touch phone",
  "os" => %{
    "family" => "Android",
    "version" => %{
      "major" => nil,
      "minor" => nil,
      "patch" => nil,
      "patch_minor" => nil
    }
  },
  "parentId" => "generic-",
  "raw" => "Mozilla/5.0 (Linux; Android 9; ONEPLUS A5000 Build/PKQ1.180716.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/68.0.3440.91 Mobile Safari/537.36",
  "vendor" => "generic",
  "version" => %{
    "major" => "68",
    "minor" => "0",
    "patch" => "3440",
    "patch_minor" => "91"
  }
}

Google bot:

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Safari/537.36

%{
  "ajax_support_javascript" => true,
  "device" => %{"brand" => "Spider", "family" => "Spider", "model" => "Desktop"},
  "device_os" => "-",
  "displayHeight" => 900,
  "displayWidth" => 1600,
  "family" => "Googlebot",
  "id" => "desktopCrawler",
  "inputDevices" => "-",
  "is_crawler" => true,
  "is_desktop" => false,
  "is_phone" => false,
  "is_tablet" => false,
  "is_wireless_device" => false,
  "model" => "browser",
  "os" => %{"family" => nil, "version" => nil},
  "parentId" => "desktopDevice",
  "raw" => "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Safari/537.36",
  "vendor" => "desktop",
  "version" => %{
    "major" => "2",
    "minor" => "1",
    "patch" => nil,
    "patch_minor" => nil
  }
}