Skip to main content

Overview

This guide provides instructions for retrieving attribution details using the AppTrove iOS SDK to understand how users discovered your app. Campaign data enables personalized user experiences and detailed campaign analysis.

Prerequisites

  • iOS 10.0 or later and Xcode 12.0 or later
  • Access to the Trackier Panel for campaign configuration
  • Basic knowledge of Swift and iOS development

Getting Campaign Data

Retrieve attribution details to gain insights into campaign performance, such as ad names, campaign IDs, and click identifiers. The AppTrove SDK provides methods to access this data, which can be used to tailor in-app content or analyze marketing strategies.

📊 Available Campaign Data Methods

MethodDescriptionReturnsUse Case
getAd()Returns the ad nameStringUnderstand which specific ad creatives drive the most conversions or installs.
getAdID()Returns the ad IDStringDebug ad performance or fetch analytics for specific ads using their unique ID.
getAdSet()Returns the ad set nameStringCompare performance across different targeting groups or user segments.
getAdSetID()Returns the ad set IDStringUse for internal mapping or reporting by referencing ad set identifiers.
getCampaign()Returns the campaign nameStringAnalyze which campaigns generate the most user engagement or ROI.
getCampaignID()Returns the campaign IDStringSync campaign data with your internal tools or CRM using unique IDs.
getChannel()Returns the channel nameStringIdentify which marketing channel (email, social, search, etc.) is most effective.
getClickId()Returns the click IDStringTrack and attribute installs or actions to a specific click in a campaign.
getPid()Returns the partner IDStringIdentify the affiliate or partner source responsible for driving the traffic.
getP1() to getP5()Returns custom parameter valuesStringCapture custom attributes like coupon codes, experiment flags, or campaign tags.
getDlv()Returns the deep link valueStringDeep link users to a specific screen or product page for a better onboarding experience.
getIsRetargeting()Checks if user is retargetedBooleanSegment and personalize content for users returning through retargeting campaigns.

Usage

Use the TrackierSDK methods to retrieve campaign data and associate it with an event. The following example demonstrates retrieving campaign data and tracking an event.

UserDetails.swift
func userDetails() {
let event = TrackierEvent(id: "EwQP98t4Ns")
var ad = TrackierSDK.getAd()
var adID = TrackierSDK.getAdID()
var adSet = TrackierSDK.getAdSet()
var adSetID = TrackierSDK.getAdSetID()
var campaign = TrackierSDK.getCampaign()
var campaignID = TrackierSDK.getCampaignID()
var channel = TrackierSDK.getChannel()
var clickId = TrackierSDK.getClickId()
var p1 = TrackierSDK.getP1()
var p2 = TrackierSDK.getP2()
var p3 = TrackierSDK.getP3()
var p4 = TrackierSDK.getP4()
var p5 = TrackierSDK.getP5()
var dlv = TrackierSDK.getDlv()
var pid = TrackierSDK.getPid()
var retargetting = TrackierSDK.getIsRetargeting()
TrackierSDK.trackEvent(event: event)
}


Best Practices

  • Retrieve Data Early: Call campaign data methods after SDK initialization to ensure data is available for events.
  • Use Data for Personalization: Leverage campaign data (e.g., getCampaign(), getP1()) to tailor in-app content based on the user's acquisition source.
  • Test in Development Mode: Use ENV_TESTING or ENV_DEVELOPMENT to validate campaign data retrieval without affecting production data.
  • Ensure Privacy Compliance: Handle campaign data in accordance with privacy regulations (e.g., GDPR, CCPA).

Troubleshooting

  • Campaign Data Not Retrieved: Verify the SDK is initialized and campaign tracking is enabled in the Trackier Panel.
  • Missing Data: Ensure the campaign is correctly configured in the Trackier Panel and the app is receiving attribution data.
  • Retargeting Issues: Confirm the getIsRetargeting() method returns the expected value by checking campaign settings.

For further assistance, refer to the Trackier Documentation Portal or contact Trackier support at support@trackier.com.