Amplitude
Send subscriptions events to Amplitude . Glassfy monitor the subscriptions and sends all the relevant events to Amplitude even if the user does not open the app.
- Copy the “API Key” from Amplitude ORG SETTINGS -> Projects -> General
- Open Amplitude connector setting in the Glassfy dashboard and paste the “API Key”
- If you are integrating the Amplitude SDK in your app you can following this instruction to connect the events data with the user.
Event format
Glassfy will send to Amplitude a record with the following format every time an event is generated
{
"api_key": "XXXXXXXXXXXXX",
"events": [
{
"event_type": "SubscriptionRenewed",
"user_id": "43ac4928d1c048eab25dec698ae4f0bd",
"time": 1619706461000,
"app_version": "1.0",
"os_name": "iOS",
"device_manufacturer": "Apple",
"os_version": "12.5.1",
"sdk_version": "dev",
"bundle_version": "66",
"country": "GB",
"revenue": 2.7772076344423917,
"productId": "ios_premium_weekly_1_99",
"quantity": 1,
"event_properties": {
"expires_at": 1607955966000,
"purchased_at": 1607955786000,
"environment": "Sandbox",
"product_permissions": "articles,",
"presented_offering_id": "",
"transaction_id": "1000000788008512",
"original_transaction_id": "1000000754137991"
}
}
]
}
Integrate with Amplitude SDK
If you optionally integrate the Amplitude SDK in your app please follow the instructions here and add the following code.
-
Glassfy.initialize(apiKey: "YOUR_API_KEY", userId: "appUserId") func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Enable sending automatic session events Amplitude.instance()?.trackingSessionEvents = true // Initialize SDK Amplitude.instance()?.initializeApiKey("API_KEY") // Set userId Amplitude.instance()?.setUserId("userId") // Log an event Amplitude.instance()?.logEvent("app_start") return true } -
[Glassfy initializeWithAPIKey:@"YOU_API_KEY" userId:@"appUserId"]; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Enable sending automatic session events [Amplitude instance].trackingSessionEvents = YES; // Initialize SDK [[Amplitude instance] initializeApiKey:@"API_KEY"]; // Set userId [[Amplitude instance] setUserId:@"userId"]; // Log an event [[Amplitude instance] logEvent:@"app_start"]; return YES; }