iOS SDK
The Inhouse iOS SDK provides comprehensive tracking and analytics capabilities for your native iOS applications, including shortlink tracking, install attribution, and deep linking support.Deep Linking Flow
The iOS SDK enables seamless deep linking between web and mobile experiences:Installation
Swift Package Manager
Add the SDK using Swift Package Manager:- In Xcode, go to File > Add Package Dependencies
- Enter the repository URL:
https://github.com/tryinhouse/ios-sdk - Select the latest version and click Add Package
CocoaPods
Add the SDK to yourPodfile:
Manual Installation
Download the framework and add it to your project:- Download the latest
InhouseTrackingSDK.framework - Drag the framework into your Xcode project
- Ensure “Copy items if needed” is checked
- Add the framework to your target’s “Frameworks, Libraries, and Embedded Content”
Quick Start
Basic Setup
Initialize the SDK in your app:View Controller Integration
For proper deep link handling, set the current view controller:Event Tracking
App Open Tracking
Track when users open your app:Session Tracking
Track user sessions:Shortlink Click Tracking
Track shortlink interactions:Custom Event Tracking
Track custom business events:Install Attribution
Install Referrer Tracking
The SDK automatically handles install attribution through App Store referrers:Install from Shortlink
Track app installs attributed to shortlinks:Fingerprint-Based Install Tracking
Track app installs using device fingerprinting (no shortlink required):Deep Linking
Universal Links Configuration
Configure universal links in your iOS app:Custom URL Schemes
Handle custom URL schemes:App Lifecycle Integration
Handle app state changes for proper tracking:SDK Information
Device and Session Information
Access SDK-generated identifiers:Debug and Testing
For development and testing:Privacy and Compliance
Data Collection
The SDK collects the following data automatically:- Device Information: Device ID (generated), user agent, IP address
- Event Data: Timestamps, event types, shortlink URLs
- Install Attribution: Install referrer data from App Store
- Session Data: Session IDs, app open/close events
User Consent
Implement user consent before initializing the SDK:Advanced Features
Network Configuration
The SDK uses URLSession for network requests with the following defaults:- Timeout: 30 seconds connection timeout
- Retry: Up to 3 retry attempts
- HTTPS: All data transmitted over HTTPS
Error Handling
Handle SDK errors in your callback:Integration Examples
E-commerce Integration
Marketing Campaign Tracking
Best Practices
Event Naming
- Use Descriptive Names: Use clear, descriptive event names like
product_view,add_to_cart - Consistent Naming: Use snake_case for event names consistently
- Meaningful Categories: Group related events with prefixes (
user_action,ecommerce_event)
Data Management
- Minimal Data: Only include necessary data in additional properties
- Consistent Properties: Use consistent property names across events
- Valid Data Types: Ensure property values are strings
Performance Optimization
- Async Tracking: All SDK methods are asynchronous by default
- Batch Processing: SDK automatically batches events for efficiency
- Network Optimization: SDK handles network retries and timeouts
Privacy and Security
- User Consent: Always respect user privacy preferences
- Data Minimization: Only collect data necessary for your use case
- Secure Transmission: SDK uses HTTPS for all data transmission
Troubleshooting
Common Issues
Events Not Sending- Verify token ID and project token are correct
- Check network connectivity
- Enable debug logging to see detailed logs
- Verify server URL configuration
- Check iOS app configuration for universal links
- Verify associated domains in your app’s entitlements
- Test deep links using Simulator or device
- Check URL scheme registration
- Ensure install referrer is properly configured
- Check App Store install referrer setup
- Verify first install detection logic
Debug Commands
Next Steps
Android SDK
Integrate with native Android apps.
API Reference
Use the REST API for advanced integration.
Deep Linking
Set up deep linking for seamless navigation.
Analytics
Understand your analytics data.
Need help with the iOS SDK? Check our API
documentation or contact
[email protected].