Skip to main content

Overview

This guide provides instructions for retrieving campaign data using the AppTrove Flutter SDK to understand how users discovered your app. Campaign data, such as ad names, campaign IDs, and click identifiers, enables personalized user experiences and detailed campaign analysis.

Prerequisites

  • A Flutter application with the AppTrove SDK installed and initialized
  • Access to the Trackier Panel for campaign configuration
  • Flutter 2.0 or later, Dart 2.12 or later
  • Basic knowledge of Dart and Flutter development

Getting Campaign Data

The AppTrove SDK provides methods to retrieve attribution details, offering insights into campaign performance. This data can be used to tailor in-app content or analyze marketing strategies by identifying the sources (e.g., ads, campaigns) that drive user acquisition.

📊 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 Trackierfluttersdk methods to retrieve campaign data asynchronously and associate it with an event. The following example demonstrates retrieving campaign data and tracking an event.

Dart Example

Getting_campaign_data.dart
void _gettingCampaignData() {
TrackierEvent trackierEvent = TrackierEvent("1CFfUn3xEY");
var ad = await Trackierfluttersdk.getAd();
var getAdID = await Trackierfluttersdk.getAdID();
var getCampaign = await Trackierfluttersdk.getCampaign();
var getCampaignID = await Trackierfluttersdk.getCampaignID();
var getAdSet = await Trackierfluttersdk.getAdSet();
var getAdSetID = await Trackierfluttersdk.getAdSetID();
var getP1 = await Trackierfluttersdk.getP1();
var getP2 = await Trackierfluttersdk.getP2();
var getP3 = await Trackierfluttersdk.getP3();
var getP4 = await Trackierfluttersdk.getP4();
var getP5 = await Trackierfluttersdk.getP5();
var getClickId = await Trackierfluttersdk.getClickId();
var getDlv = await Trackierfluttersdk.getDlv();
var getPid = await Trackierfluttersdk.getPid();
var getIsRetargeting = await Trackierfluttersdk.getIsRetargeting();
Trackierfluttersdk.trackEvent(trackierEvent);
}

note

Ensure the SDK is initialized before calling these methods to avoid null responses. The trackEvent call in the example associates the campaign data with the specified event (1CFfUn3xEY).


Best Practices

  • Retrieve Data Early: Call campaign data methods after SDK initialization to ensure data is available for events.
  • Use for Personalization: Leverage data (e.g., getCampaign(), getP1()) to tailor in-app content based on the user's acquisition source.
  • Test in Development Mode: Use "development" or "testing" environments to validate campaign data retrieval without affecting production data.
  • Log Data for Debugging: Print or log campaign data during testing to verify accuracy and completeness.
  • 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.
  • Network Errors: Check network connectivity, as campaign data retrieval requires an internet connection.

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