A comprehensive Flutter application demonstrating the full capabilities of the Trackier SDK, including event tracking, deep linking, dynamic links, campaign attribution, and Firebase Analytics integration.
π Official Documentation: AppTrove Flutter SDK Documentation
This simulator app demonstrates the following Trackier SDK features:
- Built-in events (ADD_TO_CART, PURCHASE, LOGIN, etc.)
- Custom events with parameters
- Revenue tracking with currency support
- User property setting
- Deferred deep link parsing
- Deep link navigation
- Parameter extraction and routing
- Deep link value (DLV) handling
- Dynamic link creation with attribution
- Deep link resolution
- Platform-specific redirects
- Social media previews
- Campaign data retrieval
- Ad attribution tracking
- Custom parameter tracking (P1-P5)
- Retargeting detection
- Firebase Analytics for uninstall tracking
- User property mapping
- Cross-platform analytics
- iOS attribution token handling
- App Store attribution tracking
- CleverTap integration for advanced analytics
- WebEngage for user engagement
- Android Install Referrer for accurate attribution
- App Links for deep link handling
- Flutter DotEnv for environment configuration
- Flutter SDK (3.5.4 or higher)
- Dart SDK
- iOS 13.0+ / Android API 21+
- Firebase project setup
- Trackier account and credentials
git clone <repository-url>
cd flutter-sdk-simulator
flutter pub get
Create a .env
file in the root directory:
# Trackier SDK Configuration
TR_DEV_KEY=your_trackier_dev_key_here
SECRET_ID=your_secret_id_here
SECRET_KEY=your_secret_key_here
- Add your
GoogleService-Info.plist
toios/Runner/
- Add your
google-services.json
toandroid/app/
- Update
lib/firebase_options.dart
with your Firebase configuration
cd ios
pod install
cd ..
The app includes comprehensive Android configurations:
Permissions (automatically configured):
INTERNET
- Network accessACCESS_NETWORK_STATE
- Network state monitoringACCESS_WIFI_STATE
- WiFi state accessREAD_PHONE_STATE
- Device informationREAD_EXTERNAL_STORAGE
- File accessMANAGE_EXTERNAL_STORAGE
- External storageAD_ID
- Google Advertising ID
Deep Link Configuration:
- Intent filters for
https://trackier58.u9ilnk.me/d/*
- Meta app queries for Facebook, Instagram
- Package visibility for attribution
flutter run
Location: lib/Screens/HomeScreen.dart
The main navigation hub featuring:
- Trackier logo display
- Navigation buttons to all feature screens
- Welcome message
Features:
- Centralized navigation to all SDK features
- Clean, intuitive interface
- Branded with Trackier logo
Location: lib/Screens/BuildinEventScreen.dart
Demonstrates tracking of predefined events:
Available Events:
ADD_TO_CART
- Track when users add items to cartPURCHASE
- Track completed purchasesLOGIN
- Track user loginsCOMPLETE_REGISTRATION
- Track user registrationsLEVEL_ACHIEVED
- Track game level completionsTUTORIAL_COMPLETION
- Track tutorial completions- And 9 more built-in events...
Features:
- Event selection dropdown
- Revenue input with currency selection (50+ currencies)
- Custom parameter addition (up to 10 parameters)
- Real-time event tracking
- Success/error feedback
How to Use:
- Select an event from the dropdown
- Enter revenue amount (optional)
- Select currency
- Add custom parameters (optional)
- Tap "Track Event" to send the event
Location: lib/Screens/CustomEventsScreen.dart
For tracking custom events with your own event IDs:
Features:
- Custom event ID input
- Revenue and currency tracking
- Custom parameter support
- Event validation
- Real-time tracking
How to Use:
- Enter your custom event ID
- Set revenue and currency (optional)
- Add custom parameters
- Track the event
Location: lib/Screens/DeepLinkScreen.dart
Handles deep link processing and navigation:
Features:
- Deep link URL input
- Parameter extraction
- Navigation routing
- Deep link value (DLV) handling
- URL validation
- MethodChannel integration for native deep link handling
- Automatic navigation to CakeScreen based on parameters
How to Use:
- Enter a deep link URL
- Tap "Process Deep Link"
- View extracted parameters
- Navigate to appropriate screen
Location: lib/Screens/CakeScreen.dart
Product detail screen demonstrating deep link navigation:
Features:
- Product image display
- Product information
- Price display
- Deep link parameter handling
- Navigation back to home
Products Available:
- Blueberry Cupcake
- Chocolate Chip Cupcake
- Vanilla Cupcake
Location: lib/Screens/DynamicLinkScreen.dart
Create and resolve dynamic links:
Features:
- Template ID configuration
- Platform-specific redirects (Android, iOS, Desktop)
- SDK parameters (product_id, quantity)
- Attribution parameters (channel, media_source, campaign)
- Social meta tags (Open Graph)
How to Use:
- Fill in basic parameters (Template ID, Link, Domain)
- Set platform redirects
- Add SDK parameters
- Configure attribution parameters
- Set social meta tags
- Tap "Create Dynamic Link"
Features:
- URL resolution
- Parameter extraction
- Full URL display
- Copy to clipboard
How to Use:
- Enter a dynamic link URL
- Tap "Resolve Deep Link"
- View the resolved URL with parameters
Location: lib/Screens/CampaignDataScreen.dart
Retrieve and display campaign attribution data:
Available Data:
- Ad Information: Ad name, Ad ID
- Campaign Data: Campaign name, Campaign ID
- Ad Set Data: Ad Set name, Ad Set ID
- Attribution: Click ID, Partner ID, Deep Link Value
- Custom Parameters: P1, P2, P3, P4, P5
- Retargeting: Is Retargeting flag
Features:
- Real-time data retrieval
- Event tracking with campaign data
- Data validation
- Copy functionality
How to Use:
- Enter event ID (optional)
- Tap "Get Campaign Data"
- View all available attribution data
- Track event with campaign data (optional)
Location: lib/Screens/ProductPageScreen.dart
E-commerce product page simulation:
Features:
- Product catalog display
- Add to cart functionality
- Purchase simulation
- Event tracking integration
Event Tracking:
- Product view event tracking (Event ID:
jKw8qPF50u
) - Add to cart event tracking (Event ID:
Fy4uC1_FlN
) - Custom event IDs for e-commerce flow
- Navigation to cart screen
Location: lib/Screens/AddtoCartScreen.dart
Shopping cart functionality:
Features:
- Cart item management
- Quantity updates
- Checkout process
- Event tracking
Event Tracking:
- Purchase event with revenue tracking (Event ID:
Q4YsqBKnzZ
) - User additional details setting
- Product information tracking
- Success feedback
Location: lib/Screens/SplashScreen.dart
Initial app loading screen:
Features:
- App logo display
- 3-second loading animation
- Automatic navigation to home screen
- Branded with Trackier Simulator title
How it Works:
- Displays app logo and title
- Waits for 3 seconds
- Automatically navigates to main home screen
- Handles deep link initialization in background
The app initializes multiple SDKs in the correct order:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// 1. Firebase initialization
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
// 2. Load environment variables
await dotenv.load();
// 3. Handle initial deep link
final Uri? initialDeepLink = await _getInitialDeepLink();
// 4. Run app
runApp(MyApp(initialDeepLink: initialDeepLink));
// 5. Initialize SDKs after app is running
WidgetsBinding.instance.addPostFrameCallback((_) {
_initializeSDKs();
});
}
void _initializeSDKs() async {
// 1. Apple Search Ads token (iOS only)
if (Platform.isIOS) {
final token = await AppleSearchAdsHelper.getAttributionToken();
if (token != null) {
Trackierfluttersdk.updateAppleAdsToken(token);
}
}
// 2. Deep link parsing
Trackierfluttersdk.parseDeeplink(testDeepLink);
// 3. Trackier SDK initialization
Trackierfluttersdk.initializeSDK(config);
// 4. Firebase user property setting
_setTrackierUserProperty();
// 5. App open event tracking
_trackAppOpen();
}
The app implements comprehensive deep link handling:
trackerSDKConfig.deferredDeeplinkCallback = (uri) {
if (uri != null && uri.isNotEmpty) {
final Uri resolvedUri = Uri.parse(uri);
final String? dlv = resolvedUri.queryParameters['dlv'];
if (dlv != null) {
switch (dlv) {
case 'blueberrycupcake':
// Navigate to blueberry cupcake screen
break;
case 'chocochipcupcake':
// Navigate to chocolate chip cupcake screen
break;
// ... other cases
}
}
}
};
Events are tracked with comprehensive data:
TrackierEvent event = TrackierEvent(TrackierEvent.PURCHASE);
event.revenue = 29.99;
event.currency = "USD";
event.orderId = "ORDER_123";
event.param1 = "premium_user";
event.param2 = "mobile_app";
Trackierfluttersdk.trackEvent(event);
The SDK supports encrypted event tracking:
trackerSDKConfig.setAppId("YOUR_APP_ID");
trackerSDKConfig.setEncryptionKey("YOUR_ENCRYPTION_KEY");
trackerSDKConfig.setEncryptionType(TrackierEncryptionType.AES_GCM);
Secure API communication:
trackerSDKConfig.setAppSecret(secretId, secretKey);
- Apple Search Ads attribution
- App Store attribution
- iOS-specific deep link handling
- Firebase Analytics integration
- Google Play Store attribution
- Android Install Referrer
- Google Advertising ID
- Android-specific deep link handling
Custom implementation for iOS attribution token handling:
// Apple Search Ads Helper
class AppleSearchAdsHelper {
static Future<String?> getAttributionToken() async {
if (defaultTargetPlatform != TargetPlatform.iOS) {
return null;
}
try {
final String? token = await _channel.invokeMethod('getAttributionToken');
return token;
} on PlatformException catch (e) {
print('Error getting Apple Search Ads attribution token: ${e.message}');
return null;
}
}
}
Firebase Analytics integration for uninstall tracking:
Future<void> _setTrackierUserProperty() async {
var trackierId = await Trackierfluttersdk.getTrackierId();
await FirebaseAnalytics.instance.setUserProperty(
name: "ct_objectId",
value: trackierId
);
}
Comprehensive user data tracking:
Trackierfluttersdk.setUserId("USER123");
Trackierfluttersdk.setUserEmail("user@example.com");
Trackierfluttersdk.setUserName("John Doe");
Trackierfluttersdk.setUserPhone("+1234567890");
Trackierfluttersdk.setDOB("1990-01-01");
Trackierfluttersdk.setGender(Gender.Male);
-
Firebase Configuration Error
- Ensure
GoogleService-Info.plist
is properly added to iOS project - Verify bundle ID matches Firebase configuration
- Check API key format (39 characters for iOS)
- Ensure
-
Trackier SDK Initialization Error
- Verify
.env
file exists with correct credentials - Check network connectivity
- Ensure proper SDK initialization order
- Verify
-
Deep Link Not Working
- Verify deep link URL format
- Check Android manifest configuration
- Ensure proper intent filters
-
Apple Search Ads Attribution Error
- Verify iOS 14.3+ requirement
- Check AdServices framework availability
- Ensure proper permissions
Enable debug logging:
// Add to your main.dart
import 'dart:developer' as developer;
developer.log('Debug message', name: 'TrackierSDK');
Trackierfluttersdk.trackEvent(event)
- Track eventsTrackierfluttersdk.trackSession()
- Track app sessions
Trackierfluttersdk.setUserId(id)
- Set user IDTrackierfluttersdk.setUserEmail(email)
- Set user emailTrackierfluttersdk.setUserName(name)
- Set user name
Trackierfluttersdk.getAd()
- Get ad nameTrackierfluttersdk.getCampaign()
- Get campaign nameTrackierfluttersdk.getDlv()
- Get deep link value
Trackierfluttersdk.parseDeeplink(url)
- Parse deep linkTrackierfluttersdk.createDynamicLink(...)
- Create dynamic linkTrackierfluttersdk.resolveDeeplinkUrl(url)
- Resolve deep link
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Trackier Documentation: docs.trackier.com
- Trackier Support: support@trackier.com
- GitHub Issues: Create an issue
- v1.0.0 - Initial release with basic SDK features
- v1.1.0 - Added dynamic links and campaign data
- v1.2.0 - Firebase integration and uninstall tracking
- v1.3.0 - Apple Search Ads attribution support
- v1.4.0 - Enhanced deep link handling and navigation
Made with β€οΈ by the Trackier Team