Auto-properties are $-prefixed properties Pug attaches to events automatically: the SDK sets its own before an event leaves the device, and the server adds more at ingestion. You don’t need to set any yourself; what happens to a server-set one you send depends on the property (see Server-set properties).
The $ prefix is reserved. autoProperties keys must start with $ and customProperties keys must not; a request that breaks either rule fails whole with invalid_argument (see Events API).
SDK-set properties: Web
Set by @pug-sh/browser on every event, all as strings.
| Property | Type | Description | Example |
|---|---|---|---|
$projectId |
string | Project ID passed to init() |
d47k2sl3gmq7c1tvb6e0 |
$platform |
string | Always web |
web |
$url |
string | Current page URL (window.location.href), with redactUrlParams applied |
https://app.example.com/pricing |
$referrer |
string | document.referrer, redacted the same way; an empty string when there is none |
https://google.com |
$pageTitle |
string | Page title (document.title), on page_view only |
Pricing - Acme |
$locale |
string | Browser locale (navigator.language) |
en-US |
$screenWidth |
string | Screen width in CSS pixels (window.screen.width) |
1920 |
$screenHeight |
string | Screen height in CSS pixels (window.screen.height) |
1080 |
$sdkVersion |
string | Web SDK version | 0.1.8 |
$browser |
string | Browser name, from navigator.userAgentData brands |
Google Chrome |
$browserVersion |
string | Browser major version | 124 |
$os |
string | Operating system (navigator.userAgentData.platform) |
macOS |
$osVersion |
string | OS version (high-entropy hint) | 14.4.1 |
$device |
string | Device model (high-entropy hint); desktops report none | Pixel 8 |
$mobile |
string | "true" or "false": whether the browser reports a mobile device |
"false" |
$utmSource |
string | utm_source query parameter |
google |
$utmMedium |
string | utm_medium query parameter |
cpc |
$utmCampaign |
string | utm_campaign query parameter |
spring_sale |
$utmContent |
string | utm_content query parameter |
banner_a |
$utmTerm |
string | utm_term query parameter, decoded |
analytics software |
$browser, $browserVersion, $os, $osVersion, $device and $mobile come from the User-Agent Client Hints API, which only Chromium browsers expose; other browsers get them from the server. $osVersion and $device are read asynchronously after init(), so events built before that read resolves, such as the first page_view, lack them. UTM parameters are read from window.location.search for each event, and each is sent only when present. beforeSend can change or remove any of these except $projectId, $platform and $sdkVersion.
See Auto-tracking for which events the SDK sends itself.
SDK-set properties: Android
Set by sh.pug:android on every event. Device and app details are read when Pug.init runs, and locale, time zone, display and network type for each event. A value the device doesn’t report is left out.
| Property | Type | Description | Example |
|---|---|---|---|
$projectId |
string | Project ID passed to Pug.init |
d47k2sl3gmq7c1tvb6e0 |
$sdkVersion |
string | Android SDK version | 0.2.1 |
$platform |
string | Always android |
android |
$os |
string | Always Android |
Android |
$osVersion |
string | Android release (Build.VERSION.RELEASE) |
15 |
$device |
string | Device model (Build.MODEL) |
Pixel 9 |
$deviceModel |
string | Same value as $device |
Pixel 9 |
$deviceManufacturer |
string | Manufacturer (Build.MANUFACTURER) |
Google |
$deviceType |
string | tv on Android TV, else mobile |
mobile |
$mobile |
boolean | true unless a TV or a tablet (smallest width of 600 dp or more) |
true |
$screenWidth |
integer | Display width in dp, in the current orientation | 412 |
$screenHeight |
integer | Display height in dp, in the current orientation | 915 |
$screenScale |
number | Display density | 2.625 |
$locale |
string | Device locale as a BCP 47 language tag | en-US |
$timezone |
string | IANA timezone identifier | Europe/Berlin |
$appName |
string | App label from the manifest | Acme |
$appPackage |
string | Package name | com.example.acme |
$appVersion |
string | versionName |
1.4.2 |
$appBuild |
string | versionCode |
42 |
$networkType |
string | Active connectivity type, only when your app holds ACCESS_NETWORK_STATE, which the SDK doesn’t declare |
wifi, mobile, ethernet, vpn, bluetooth, other, none, unknown |
$url |
string | Current screen: the resumed activity’s simple class name, or the name passed to Pug.screen |
CheckoutActivity |
$referrer |
string | Previous screen | CartActivity |
The device name is never collected. See Auto-tracking for the events that move $url and $referrer.
SDK-set properties: iOS
Set by the iOS SDK (github.com/pug-sh/sdk-ios) on every event. Locale, time zone and network type are read for each event; the OS version and the screen each time the app comes to the foreground or a screen appears, and with each SDK call made on the main thread; the rest once per launch. A value the device doesn’t report is left out.
| Property | Type | Description | Example |
|---|---|---|---|
$projectId |
string | Project ID passed to Pug.initialize |
d47k2sl3gmq7c1tvb6e0 |
$sdkVersion |
string | iOS SDK version | 0.1.0 |
$platform |
string | Always ios |
ios |
$os |
string | Always iOS, on an iPad too |
iOS |
$osVersion |
string | iOS or iPadOS version | 26.1 |
$device |
string | The model’s marketing name, or its hardware identifier for a model the SDK doesn’t know yet; on a simulator, the simulated model | iPhone 16 Pro |
$deviceModel |
string | Same value as $device |
iPhone 16 Pro |
$deviceManufacturer |
string | Always Apple |
Apple |
$deviceType |
string | desktop for an iPhone or iPad app running on a Mac, else mobile |
mobile |
$mobile |
boolean | true on an iPhone; false on an iPad and on a Mac |
true |
$screenWidth |
integer | Screen width in points, in the current orientation | 402 |
$screenHeight |
integer | Screen height in points, in the current orientation | 874 |
$screenScale |
number | Screen scale | 3.0 |
$locale |
string | The user’s preferred language and region as a BCP 47 language tag | en-US |
$timezone |
string | IANA timezone identifier | Europe/Berlin |
$appName |
string | CFBundleDisplayName, else CFBundleName |
Acme |
$appPackage |
string | Bundle identifier | com.example.acme |
$appVersion |
string | CFBundleShortVersionString |
1.4.2 |
$appBuild |
string | CFBundleVersion |
42 |
$networkType |
string | Active connectivity type; reading it needs no permission | wifi, mobile, ethernet, other, none, unknown |
$url |
string | Current screen: a view controller’s type name, or the name passed to pugScreen or Pug.screen |
CheckoutViewController |
$referrer |
string | Previous screen | CartViewController |
The device name is never collected. See Auto-tracking for the events that move $url and $referrer.
SDK-set properties: Flutter
Set by pug_flutter on every event. App, device and network details, the IANA time zone and the OS on web are read once, at Pug.init; the rest for each event. With a custom autoPropertyProvider, the SDK sets only $projectId, $sdkVersion, $url and $referrer, and the provider supplies the rest, $platform included.
Core
| Property | Type | Description | Example |
|---|---|---|---|
$projectId |
string | Project ID passed to Pug.init |
d47k2sl3gmq7c1tvb6e0 |
$sdkVersion |
string | Flutter SDK version | 0.1.1 |
$platform |
string | web on Flutter web; otherwise the lowercase operating system: android, ios, macos, linux, windows, fuchsia, with anything else passed through lowercased (changed in 0.0.3) |
ios |
$deviceType |
string | Form factor: tv, mobile or desktop. Omitted on web and on any target it can’t classify |
mobile |
$os |
string | Platform.operatingSystem, equal to $platform. On web, the Client Hints platform, Chromium only |
android |
$osVersion |
string | The OS release on Android and iOS; on desktop, or when that’s missing, Dart’s free-form Platform.operatingSystemVersion. On web, the Client Hints version, Chromium only |
14 |
$locale |
string | Device locale as a BCP 47 language tag | en-US |
$timezone |
string | IANA timezone identifier from flutter_timezone, else DateTime.now().timeZoneName’s abbreviation |
America/New_York |
$url |
string | Current route name, once a PugRouteObserver is wired |
/checkout |
$referrer |
string | Previous route name, set alongside $url |
/cart |
Screen
| Property | Type | Description | Example |
|---|---|---|---|
$screenWidth |
integer | Logical width of the app’s view in dp; on desktop and web, the window rather than the screen | 390 |
$screenHeight |
integer | Logical height of the same view | 844 |
$screenScale |
number | Device pixel ratio | 3.0 |
App
| Property | Type | Description | Example |
|---|---|---|---|
$appName |
string | App name from PackageInfo |
Acme App |
$appPackage |
string | Bundle / package identifier | com.example.acme |
$appVersion |
string | App version string | 1.4.2 |
$appBuild |
string | App build number | 42 |
Device (populated per platform)
| Property | Platform | Description | Example |
|---|---|---|---|
$deviceManufacturer |
Android, iOS, macOS, Linux | The manufacturer on Android, Apple on iOS and macOS, and the distribution’s full name on Linux |
Samsung, Apple, Ubuntu 24.04.1 LTS |
$deviceModel |
Android, iOS, macOS, Linux, Windows | The model on Android. On iOS and macOS the marketing name, falling back to UIDevice.model (iPhone) on iOS and the model identifier on macOS; the distribution’s name on Linux; the Windows product name |
iPhone 15 Pro, MacBookPro18,3, Windows 11 Pro |
The user-assigned device name is never collected. For phone versus desktop, use $deviceType rather than parsing $deviceModel.
Network
| Property | Type | Description | Example |
|---|---|---|---|
$networkType |
string | Connectivity type when Pug.init ran |
wifi, mobile, ethernet, vpn, bluetooth, other, none, unknown |
See Auto-tracking for the navigation events a PugRouteObserver sends: screen_view on mobile, page_view on web.
SDK-set properties: Node
Set by @pug-sh/node on every event.
| Property | Type | Description | Example |
|---|---|---|---|
$lib |
string | Library identifier: always pug-node |
pug-node |
$sdkVersion |
string | Node SDK version | 0.1.0 |
$platform |
string | Always server |
server |
The only other auto-properties it sets are the geo keys that track()’s location option (0.0.6+) renders, and props become custom properties, so pass anything else there. It sets no $projectId. Its requests use a private key, so the server adds no geo or user agent to its events (Server-set properties): without location they land in the empty bucket of a $country or $browser breakdown. To set $browser and the like on a server event, send it over the HTTP API.
SDK-set properties: Go
Set by github.com/pug-sh/sdk-go on every event.
| Property | Type | Description | Example |
|---|---|---|---|
$lib |
string | Library identifier: always pug-go |
pug-go |
$sdkVersion |
string | Go SDK version | 0.0.1 |
$platform |
string | Always server |
server |
As with Node, the only other auto-properties it sets are the geo keys pug.WithLocation renders, it sets no $projectId, and the server adds no geo or user agent to its events.
SDK-set properties: Ruby
Set by pug-sh on every event.
| Property | Type | Description | Example |
|---|---|---|---|
$lib |
string | Library identifier: always pug-ruby |
pug-ruby |
$sdkVersion |
string | Ruby SDK version | 0.1.1 |
$platform |
string | Always server |
server |
As with Node, the only other auto-properties it sets are the geo keys track’s location option renders, it sets no $projectId, and the server adds no geo or user agent to its events.
Casing differences between SDKs
Every SDK sets $platform and $sdkVersion, and the server never sets $platform. $platform values are lowercase in every SDK and stored as sent, so a breakdown on it groups traffic by platform across SDKs: Flutter shares android, ios and web with the Android, iOS and Web SDKs, and the three server SDKs all send server, which $lib tells apart. Auto-property keys are camelCase, except the server-set $bot_reason, $bot_score and $verified_bot.
| SDK | $platform value |
Example |
|---|---|---|
@pug-sh/browser |
always web |
web |
sh.pug:android |
always android |
android |
github.com/pug-sh/sdk-ios |
always ios |
ios |
pug_flutter |
web on Flutter web, else the lowercase OS |
android, ios, macos |
@pug-sh/node |
always server |
server |
github.com/pug-sh/sdk-go |
always server |
server |
pug-sh |
always server |
server |
The Web, Android, iOS and Flutter SDKs name shared concepts as below. “not set” means the SDK doesn’t send the property though its platform has the concept; “not applicable” means the platform doesn’t. Node, Go and Ruby are left out: they set only $lib, $sdkVersion, $platform and the geo keys from location.
| Concept | Web SDK property | Android SDK property | iOS SDK property | Flutter SDK property |
|---|---|---|---|---|
| URL / screen name | $url (full URL) |
$url (current activity or Pug.screen name) |
$url (current view controller, pugScreen or Pug.screen name) |
$url (current route name; set when PugRouteObserver is wired) |
| Page / screen title | $pageTitle (on page_view only) |
not set | not set | not set |
| Referrer | $referrer |
$referrer (previous screen) |
$referrer (previous screen) |
$referrer (previous route name) |
| Platform | $platform (always web) + $os (Client Hints platform) |
$platform (always android) + $os (always Android) |
$platform (always ios) + $os (always iOS) |
$platform (web, or the lowercase OS) + $os (equals $platform natively) |
| OS version | $osVersion |
$osVersion |
$osVersion |
$osVersion |
| Browser | $browser |
not applicable | not applicable | not set (on web, the server sets it) |
| Browser version | $browserVersion |
not applicable | not applicable | not set (on web, the server sets it) |
| Device model | $device |
$device and $deviceModel (same value) |
$device and $deviceModel (same value) |
$deviceModel |
| Form factor | $mobile (string "true"/"false") |
$deviceType (tv or mobile) + $mobile (boolean) |
$deviceType (mobile or desktop) + $mobile (boolean) |
$deviceType (tv, mobile or desktop; omitted on web) |
| Screen width | $screenWidth (string; the screen) |
$screenWidth (integer) |
$screenWidth (integer, points) |
$screenWidth (integer; the window on desktop and web) |
| Screen height | $screenHeight (string) |
$screenHeight (integer) |
$screenHeight (integer, points) |
$screenHeight (integer) |
| Locale | $locale |
$locale |
$locale |
$locale |
| Timezone | not set client-side | $timezone |
$timezone |
$timezone |
| UTM source | $utmSource |
not set | not set | not set |
| UTM medium | $utmMedium |
not set | not set | not set |
| UTM campaign | $utmCampaign |
not set | not set | not set |
| UTM term | $utmTerm |
not set | not set | not set |
| UTM content | $utmContent |
not set | not set | not set |
| App info | not applicable | $appName, $appPackage, $appVersion, $appBuild |
$appName, $appPackage, $appVersion, $appBuild |
$appName, $appPackage, $appVersion, $appBuild |
| Network type | not set | $networkType (with ACCESS_NETWORK_STATE) |
$networkType |
$networkType (at Pug.init) |
The server stores $mobile as a boolean whichever form arrives. Flutter’s campaign capture, which set the $utm* properties and the click IDs $gclid, $fbclid, $msclkid and $ttclid, was removed in 0.0.5, and no SDK sends click IDs.
Server-set properties
The ingestion server adds these during BatchCreate. Geo and user-agent properties are derived only on public-key requests: on a private-key request the connection is your backend, so the server derives neither and keeps those the event carries. $ip is stripped from every event and never stored.
Six keys are server-only, and any value a client sends for them is dropped: $bot and $bot_reason (bot tagging), $bot_score and $verified_bot (below), and $channel and $referrerDomain (below).
On every request the server also derives these from the event’s own properties. $channel and $referrerDomain are always its own, $locale is rewritten in place, and each of the others is set only when the event doesn’t carry it.
| Property | Derived from | Example |
|---|---|---|
$pathname |
The path of $url, decoded; / when empty |
/pricing |
$hostname |
The host of $url, lowercased |
app.example.com |
$referrerDomain |
The host of $referrer, lowercased, minus one leading www.; empty for a self-referral (the host of $url) or a sign-in host such as accounts.google.com |
google.com |
$channel |
The marketing channel, from the UTMs and $referrerDomain (below) |
Organic Search |
$utmSource, $utmMedium, $utmCampaign, $utmTerm, $utmContent |
The matching utm_* parameter of $url |
google |
$screenSize |
$screenWidth and $screenHeight as WIDTHxHEIGHT, when both are positive integers |
1920x1080 |
$locale |
The event’s $locale, re-cased with _ read as -: en_us becomes en-US |
en-US |
$pathname, $hostname, $channel and the UTMs need $url to be an http or https URL with a host, such as the Web SDK’s; Android’s, iOS’s and Flutter’s $url is a screen or route name, so their events get none of them.
$channel takes the first value that applies: Paid Search, Paid Social or Paid Video for a paid utm_medium (containing cp, exactly ppc or retargeting, or starting with paid) whose source or referrer is a search engine, social network or video site; Display for a display, banner, expandable, interstitial or cpm medium; Paid Other for any other paid medium; Organic Search, Organic Social or Organic Video for a search, social or video source or referrer, or an organic, social or video medium; Email for an email or newsletter source or medium, or a webmail referrer; Affiliate for an affiliate medium; Referral for any other referrer; Unassigned for UTMs that match none of these, or a referrer with no host; and Direct otherwise.
Geo enrichment (Cloudflare)
On a public-key request the server reads these from Cloudflare’s headers: $country from CF-IPCountry, which the zone’s IP Geolocation setting adds, and the rest from the “Add visitor location headers” Managed Transform. Each key the headers supply replaces the event’s own, the $timezone Android, iOS and Flutter send included, and a key they don’t supply keeps whatever the event sent. Cloudflare’s XX (unknown) and T1 (Tor) countries and Unknown regions and cities are left out. Without Cloudflare, the server derives none, and an event has only the geo properties it sends.
On a private-key request the server keeps the location the event carries, or stores none. Nothing is merged, so your $city is never paired with the edge’s $country, and a $country you send is stored verbatim: use ISO 3166-1 alpha-2, since USA or us becomes its own breakdown value and won’t render on the map. From the server SDKs, track’s location option (Node, Ruby) or pug.WithLocation in Go writes these keys, after checking the country code and coordinate ranges.
| Property | Description | Example |
|---|---|---|
$continent |
Continent code | NA |
$country |
ISO 3166-1 alpha-2 country code | US |
$region |
Region or state name | California |
$city |
City name | San Francisco |
$postalCode |
Postal / ZIP code | 94107 |
$metroCode |
Metro code (US DMA) | 807 |
$latitude |
Latitude (float64) | 37.7749 |
$longitude |
Longitude (float64) | -122.4194 |
$timezone |
IANA timezone name from Cloudflare | America/Los_Angeles |
User-agent enrichment (server-side fallback)
On a public-key request the server parses the User-Agent header and sets each of these the event doesn’t already carry, for every client SDK. Browsers without Client Hints (Firefox, Safari and every iOS browser) get them from here, and on Chromium it fills what Client Hints leave out, such as $device on a Mac. Android’s, iOS’s and Flutter’s own User-Agents yield nothing, Flutter web events get the browser’s, and a Flutter app sending through CupertinoClient or CronetClient gets values parsed from that client, with its app name, or Android, as $browser. To set these on a server event, send them over the HTTP API.
| Property | Description | Example |
|---|---|---|
$browser |
Browser name, spelled as the Web SDK spells it (Google Chrome, Microsoft Edge) |
Firefox |
$browserVersion |
Browser major version | 126 |
$os |
Operating system, spelled as the Web SDK spells it (macOS, and Linux for any distribution) |
iOS |
$osVersion |
OS version; omitted when the User-Agent freezes it (macOS 10.15, Windows 10 and 11, Chrome’s reduced Android) | 17.5.1 |
$device |
Device family: Mac for any Mac, none for other desktops or Chrome’s reduced Android |
iPhone |
$mobile |
true for an iPhone or iPod, or Android with Mobile in the User-Agent; else false |
true |
Bot signals (Cloudflare)
The server sets $bot_score and $verified_bot from Cloudflare’s CF-Bot-Score and CF-Verified-Bot headers, on private-key requests too, where they describe your backend’s connection. Without those headers, as in a self-hosted setup without Cloudflare, both are absent.
| Property | Type | Description | Example |
|---|---|---|---|
$bot_score |
integer | Cloudflare bot score (0-99; lower = more likely bot) | 2 |
$verified_bot |
boolean | true if Cloudflare identified a known good bot |
false |
Using auto-properties in queries
Filter and break down on an auto-property in Insights as on a custom property, by its full key, $ included.
Breakdown by country:
Filter to Chrome users only:
UTM campaign performance:
Only traffic Cloudflare scored as likely human:
An event without a $bot_score doesn’t match >, so this also drops all traffic Cloudflare didn’t score. Insights already leaves out events tagged $bot.
Related
- Events API: validation rules, including the
$rule for property keys - Auto-tracking: what each SDK captures automatically (Web interactions; Android activities, app lifecycle and installs; iOS view controllers, named SwiftUI screens, app lifecycle and installs; Flutter navigation, app lifecycle and installs)