Send subscriptions events to Mixpanel channel. Glassfy monitors the subscriptions and sends relevant events to Mixpanal even if the user does not have the app open.

  1. Copy the "Project Token" from the Mixpanel Dashboard -> Project Settings -> Overview
  2. Open the Mixpanel connector setting in the Glassfy dashboard and paste the "Project Token"
  3. If you are integrating the Mixpanel SDK in your app, follow these instructions to connect the events data with the user.

Event format

Glassfy sends Mixpanel two records with the following format every time an event is generated:

{
    "event": 5001
    "properties": {
        "$insert_id": "R9YECBG3ZG9ACDMHZA4GWAIFB97BXZ0T",
        "distinct_id": "appUserId",
        "product_id": "ios_premium_weekly_1_99",
        "revenue": 1.99,
        "store": "App Store",
        "subscriber_attributes": {},
        "time": 1608726707766,
        "token": "your_token"
    }
}
[{
    "$append": {
        "$transactions": {
            "$amount": 1.99,
            "$time": 1610540237000,
            "product_id": "ios_premium_weekly_1_99",
            "store": "App Store"
        }
    },
    "$distinct_id": "appUserId",
    "$token": "your_token"
}, {
    "$add": {
        "Total Tracked Revenue": 1.99
    },
    "$distinct_id": "appUserId",
    "$token": "your_token"
}]

Integrate with Mixpanel SDK

If you optionally integrate the Mixpanel SDK in your app, follow these instructions{:target="_blank"} and add the following code.

Glassfy.initialize(apiKey: "YOUR_API_KEY", userId: "appUserId")

Mixpanel.mainInstance().identify(distinctId: "appUserId")
[Glassfy initializeWithAPIKey:@"YOU_API_KEY" userId:@"appUserId"];

[[Mixpanel sharedInstance] identify:@"appUserId"];