This release adds new options to use the (sendBeacon API)[https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon] ("for analytics and diagnostics that send data to a server before the document is unloaded"). This network transport mechanism is useful for "fire-and-forget" tracking without blocking page unload, but comes at the cost of not providing any callbacks or mechanisms for knowing whether the request succeeded. There are several ways to use it for Mixpanel tracking:
// for an individual track() call
mixpanel.track('my event', {my: 'props'}, {transport: 'sendBeacon'});
// turn on for every Mixpanel call when page is unloading
// (you would use this to use sendBeacon for everything, including
// mixpanel.people calls)
window.addEventListener(unload, function() {
mixpanel.set_config({api_transport: 'sendBeacon'});
mixpanel.track('my event');
mixpanel.people.set({foo: 'bar'});
});
// initialize for all tracking; not recommended as it will prevent any
// request-retry facilities
mixpanel.init('my token', {api_transport: 'sendBeacon'});
mixpanel.track('my event');
Browser and browser-version detection has also been updated for the new line of Microsoft Edge (based on Chromium) as well as Samsung Internet browser.
Support optional navigator.sendBeacon transport for network requests
Add user agent detection for Chromium-based Edge and Samsung Internet
2.32.0 (16 Dec 2019)
Default to POST requests for event tracking and profile updates
Include $insert_id with events for deduplication support
Don't throw exception when decoding malformed URI params
Notifications test fixes
2.31.0 (19 Nov 2019)
Default API server to api-js.mixpanel.com
2.29.1 (22 Aug 2019)
Fix race condition with event-triggered in-apps
2.29.0 (6 Jun 2019)
mixpanel.identify() now sends special $identify event for advanced identity management
Fix extraneous logging for Group API calls
2.28.0 (9 Apr 2019)
Support event triggered inapps
2.27.0 (7 Mar 2019)
Support cross-subdomain tracking on TLDs longer than 6 chars (thanks @danielbaker)
Support configurable network protocol for inapp resources (thanks @mkdai)
Allow inapp links to open in new window/tab via config option (thanks @mkdai)
2.26.0 (9 Jan 2019)
Fix minification issue with DoNotTrack browser setting
Pass flag to backend indicating when $distinct_id might have been set to a pre-existing $distinct_id value instead of a generated UUID (used when resolving aliases)
2.25.0 (19 Dec 2018)
Change the behavior of opt_out_tracking_by_default to no longer override any existing opt status when the user has an opt-in cookie. It also no longer clears persistence when set to true.
Create a new param called opt_out_persistence_by_default which will determine whether SDK persistence is turned off during initialization
2.23.0 (23 Oct 2018)
Track time prop automatically with all events recording UTC timestamp (in seconds)
as the client (browser) sees it. The automatic value can be overridden by setting the
time prop explicitly in tracking calls.
Set $user_id and $device_id superprops automatically. This allows finer-grained
identity management around linking anonymous, logged-in, and logged-out behavior.
2.22.4 (1 Jun 2018)
Ensure GDPR cookies are always cleared when possible
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
If all status checks pass Dependabot will automatically merge this pull request.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Bumps mixpanel-browser from 2.32.0 to 2.33.0.
Release notes
Sourced from mixpanel-browser's releases.
Changelog
Sourced from mixpanel-browser's changelog.
Commits
bea6232
update changelog for 2.33.06af2ef4
v2.33.0aa7a919
make browserVersion available to tests in minified build6ef6837
Merge branch 'credge' into 2.33.0-rc1f97369d
update docs for sendBeaconab58d4b
usage doc for sendBeacon in mixpanel.track79f4cc6
explanatory comments re: prop minification84a774b
fix compiler errorec926b0
config docs for api method+transporteda9d0b
lib config option for sendBeacon transportDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.If all status checks pass Dependabot will automatically merge this pull request.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)