Add timezone as a user property via Snapshots
To further enrich your Heap user data, you can capture users’ timezones. The Snapshot below adds the user’s current timezone as a Heap user property by triggering Heap’s client-side [heap.addUserProperties()](https://developers.heap.io/reference#adduserproperties)
API. You can have this attached to any event that triggers at least once for users, like a pageview.
JavaScript Snapshot:
(function() {
var tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
heap.addUserProperties({
"Timezone": tz
});
})();
Updated over 1 year ago