Skip to main content

Get attribution info

Platform:
Version:

The justtrack SDK automatically determines a user’s identity and attribution after setup. This includes details about the ad the user clicked (if any), the campaign that ad belongs to, and the associated network and channel.

You can access attribution data in your app through the JustTrackSdk::getAttribution method:

const attribution = await JustTrackSdk.getAttribution();
const userType = attribution.userType;
const type = attribution.type;
const campaign = attribution.campaign;
const campaignName = campaign.name;
const campaignId = campaign.id;
const campaignType = campaign.type;
const campaignIsOrganic = campaign.isOrganic;
const partner = attribution.partner;
const partnerName = partner.name;
const partnerId = partner.id;
const channel = attribution.channel;
const channelName = channel.name;
const channelId = channel.Id;
const channelIsIncent = channel.isIncent;
const sourceId = attribution.sourceId;
const sourceBundleId = attribution.sourceBundleId;
const sourcePlacement = attribution.sourcePlacement;
const adsetId = attribution.adsetId;
const isRedownload = attribution.isRedownload;

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