Skip to main content
Version: SDK 4.7.x

Get an attribution

The justtrack SDK determines on each start (if necessary and not cached) the identity and attribution of a user. This includes information about the ad the user clicked on (if any), to which campaign that ad belongs as well as the network and channel of that campaign. The following example shows you you can access the campaign used to acquire the current user: After initializing the SDK you can simply call getAttribution to retrieve an attribution containing your justtrack user ID as well as information about the source of the user.

const attributionData: JustTrackSdk.AttributionData = await JustTrackSdk.getAttribution();
console.log('The campaign name is ' + attributionData.campaign.name);

If you are only using the justtrack dashboard to keep track of your install sources, you don't need to call getAttribution yourself.