Skip to content

Add browser-tracker-core default for os_timezone - #1338

Merged
Jethro Nederhof (jethron) merged 1 commit into
snowplow:release/4.0.0from
jethron:ostz_default
Sep 2, 2024
Merged

Add browser-tracker-core default for os_timezone#1338
Jethro Nederhof (jethron) merged 1 commit into
snowplow:release/4.0.0from
jethron:ostz_default

Conversation

@jethron

@jethron Jethro Nederhof (jethron) commented Aug 30, 2024

Copy link
Copy Markdown
Contributor

This adds a more lightweight way for the browser-tracker to get a value for the os_timezone/tz field that doesn't rely on the usual Timezone plugin.

The Timezone plugin is very data-heavy, and when minified is currently the 4th largest plugin we distribute, but populates only this single field:

$ ls -nSh ./*/dist/index.umd.min.js
-rw-r--r-- 1 1000 1004  48K Jul 24 19:00 ./browser-plugin-vimeo-tracking/dist/index.umd.min.js
-rw-r--r-- 1 1000 1004  20K Jul 24 19:00 ./browser-plugin-media/dist/index.umd.min.js
-rw-r--r-- 1 1000 1004  13K Jul 24 18:59 ./browser-plugin-snowplow-ecommerce/dist/index.umd.min.js
-rw-r--r-- 1 1000 1004  13K Jul 24 18:59 ./browser-plugin-timezone/dist/index.umd.min.js
-rw-r--r-- 1 1000 1004  11K Jul 24 18:59 ./browser-plugin-youtube-tracking/dist/index.umd.min.js
-rw-r--r-- 1 1000 1004  11K Jul 24 19:00 ./browser-plugin-media-tracking/dist/index.umd.min.js
-rw-r--r-- 1 1000 1004 9.3K Jul 24 19:01 ./browser-plugin-debugger/dist/index.umd.min.js
-rw-r--r-- 1 1000 1004 6.3K Jul 24 19:00 ./browser-plugin-form-tracking/dist/index.umd.min.js
-rw-r--r-- 1 1000 1004 5.9K Jul 24 19:00 ./browser-plugin-link-click-tracking/dist/index.umd.min.js
-rw-r--r-- 1 1000 1004 4.9K Jul 24 19:00 ./browser-plugin-enhanced-ecommerce/dist/index.umd.min.js

That plugin is no longer included by default in the sp.js build, and from my observations, rarely used when people use the browser-tracker directly, likely due to its size.

I think this value is valuable to have as a datapoint, because it enables using the derived_tstamp to actually measure the "time of day" a user is on a site without having to guess based on the region determined via GeoIP.
This adds a default to the tracker that should provide a good estimate for this value even without the use of the Timezone plugin, based on the configured timezone information available via the Internationalization API.
If the Timezone plugin is in use, it will override the value with whatever it determines.

@bundlemon

bundlemon Bot commented Aug 30, 2024

Copy link
Copy Markdown

BundleMon

Files added (6)
Status Path Size Limits
trackers/javascript-tracker/dist/sp.js
+27.72KB 30KB / +10%
libraries/browser-tracker-core/dist/index.mod
ule.js
+22.49KB 25KB / +10%
libraries/tracker-core/dist/index.module.js
+19.12KB 20KB / +10%
trackers/javascript-tracker/dist/sp.lite.js
+16.88KB 20KB / +10%
trackers/browser-tracker/dist/index.umd.min.j
s
+16.87KB 20KB / +10%
trackers/browser-tracker/dist/index.module.js
+3.49KB 5KB / +10%

Total files change +106.57KB 0%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants