attribution_linker 1.0.0
attribution_linker: ^1.0.0 copied to clipboard
A Flutter package for creating device fingerprints and linking attribution data using WebView. Collect comprehensive device information for analytics and attribution tracking.
Flutter Attribution Linker #
A Flutter package for creating device fingerprints and attribution linking using WebView. This package collects device and browser information to create a unique fingerprint for attribution tracking.
Features #
- 🔍 Device Fingerprinting: Collects comprehensive device and browser information
- 🚀 Headless WebView: Uses Flutter InAppWebView for data collection
- 💾 Caching: Fingerprint data is cached after first collection
- 🔒 Privacy-Aware: Collects only standard browser API data
- 📱 Cross-Platform: Works on iOS and Android
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
attribution_linker: ^0.0.1
Usage #
Basic Usage #
import 'package:attribution_linker/attribution_linker.dart';
// Initialize the attribution linker
final linker = AttributionLinker();
linker.init();
// Collect fingerprint data
Map<String, dynamic> fingerprint = await linker.fingerprint;
print('Device OS: ${fingerprint['os_type']}');
print('Browser: ${fingerprint['browser_name']}');
print('Screen Resolution: ${fingerprint['screen_res']}');
Fingerprint Data Structure #
The fingerprint contains the following information:
os_type: Operating system type (android, ios, macos, windows, linux, others)os_name: Operating system nameos_version: Operating system versionbrowser_name: Browser namebrowser_version: Browser versiondevice_model: Device modeldevice_type: Device typedevice_arch: Device architecturedevice_bitness: Device bitness (32/64 bit)screen_res: Screen resolution (e.g., "1920x1080")pixel_ratio: Device pixel ratiotimezone: System timezonelanguage: Browser languagecpu_cores: Number of CPU coresdevice_memory: Device memory in GBsystem_brightness: System theme (light/dark)user_agent: Full user agent string- And more...
Technical Implementation #
This package uses:
- flutter_inappwebview: For creating a headless WebView
- UAParser.js: For parsing user agent information
- Navigator APIs: For collecting device information
- Singleton Pattern: For efficient memory usage
Privacy Considerations #
This package only collects information that is freely available through standard web APIs. No personal information or unique identifiers are collected without explicit user consent.
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
License #
This project is licensed under the MIT License - see the LICENSE file for details.