Migrate to SDK 8.0
This guide walks you through upgrading an existing justtrack SDK 7.x integration to 8.0. It covers every breaking change, what to replace it with, and the new features you can adopt once you're on 8.0.
The current 8.0 build is 8.0.0-rc1. Use it to prepare and test your migration, and keep 7.x in production until 8.0.0 is final.
Update the dependency
Start by bumping the justtrack SDK dependency to 8.0.0-rc1, as described in Set up the SDK. Then work through the changes below that apply to your integration.
Breaking changes
| What changed | What to do instead |
|---|---|
getTestGroupId() removed | Use remote config or setExperimentVariant() |
type removed from the attribution | Read attribution.campaign.type |
AttributionCampaign.id is now a string | Expect the external campaign ID as a string |
Test group IDs are gone
The deprecated test group ID API is removed. Use experiments instead, either by reading assignments from remote config or by reporting a variant you decided yourself.
// Before
const testGroupId = await JustTrackSdk.getTestGroupId();
// After
const assignments = JustTrackSdk.remoteConfig.getAll();
Campaign IDs are external IDs
The campaign ID changed from an internal numeric ID to the campaign's external ID, as a string. This is the ID you see in the justtrack dashboard, so IDs from the SDK and the dashboard now match.
If you persist campaign IDs, compare them against other systems, or send them to your own backend, update those code paths and any stored values or database columns to expect strings.
Behavior changes to expect
These changes don't break compilation, but they change what your app does at runtime.
- Remote config fetches more often. The default minimum fetch interval dropped from 24 hours to 1 hour, so experiment changes reach users sooner. See Configure the fetch interval.
- Activating an experiment twice is a no-op.
activatenow only enrolls assignments that are still pending, instead of sending a redundant enrollment request.
- Event values are recognized more reliably. A
MoneyorValuethat didn't come from the exact package instance in your bundle — a plain object, a value restored from JSON, or an instance from a duplicate copy of the package — is now classified by its shape. Events that previously lost their value are published with it, which can change the revenue and value numbers you see.
Adopt the new features
Once you're on 8.0, you can use these additions:
- Set global dimensions — set a dimension once and have the SDK attach it to every event that follows.
- Track the connection type — record whether the device was online or offline for each event.
- Purchase view and click actions on
JtPurchaseEvent, with typed constructors.
For the complete list of changes in this release, see the changelog.