Skip to content

Commit

Permalink
Merge branch 'ADP-1473-sharing-mode'
Browse files Browse the repository at this point in the history
* ADP-1473-sharing-mode:
  Final version
  Version for review
  Version for review
  • Loading branch information
Lutik-sun committed Oct 23, 2024
2 parents 8db97b0 + d1644a9 commit 394eb75
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 21 deletions.
3 changes: 3 additions & 0 deletions versioned_docs/version-3.0/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ In that case following events will be sent:
| **expires_at** | ISO 8601 date | Date and time when paid access will expire. |
| **activated_at** | ISO 8601 date | Date and time when paid access was activated. |
| **billing_issue_detected_at** | ISO 8601 date | Date and time of billing issue. |
| **profile_has_access_level** | Bool | A boolean that indicates whether the profile has an active access level. |


Each event has the following properties:
Expand Down Expand Up @@ -149,6 +150,7 @@ Event example
"environment": "Sandbox",
"vendor_product_id": "premium",
"event_datetime": "2020-02-18T18:40:22.000000+0000",
"profile_has_access_level": true,
"store": "app_store"
}
```
Expand Down Expand Up @@ -209,6 +211,7 @@ Adapty has a special event `access_level_updated`. It is sent only to [webhook](
| **active_introductory_offer_type** | str |
| **active_promotional_offer_type** | str |
| **active_promotional_offer_id** | str |
| **profile_has_access_level** | bool |

We don't send `access_level_updated` upon subscription expiration - please, refer to **expires_at** value to end the subscriptions on your side.

Expand Down
14 changes: 10 additions & 4 deletions versioned_docs/version-3.0/google-cloud-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ In the Adapty Dashboard, the following fields are needed to set up the connectio
| **Google Cloud Project ID** | A user-assigned identifier for your Google Cloud project. Find this ID in the downloaded private JSON key file under the `project_id` field. |
| **Google Cloud Service Account Private Key ID** | A unique identifier assigned to your private key when you create a new service account in the Google Cloud Console. Find this ID in the downloaded private JSON key file under the `private_key_id` field. |
| **Google Cloud Bucket Name** | The name of the bucket in Google Cloud Storage where you want to store your data. It should be unique within the Google Cloud Storage environment and should not contain any spaces. |
| **Email ** | The email address associated with your service account in Google Cloud Console. It is used to grant access to resources in your project. |
| **Folder inside the bucket ** | The name of the folder inside the bucket where you want to store your data. It should be unique within the bucket and can be used to organize your data. This field is optional to fill. |
| **Email** | The email address associated with your service account in Google Cloud Console. It is used to grant access to resources in your project. |
| **Folder inside the bucket** | The name of the folder inside the bucket where you want to store your data. It should be unique within the bucket and can be used to organize your data. This field is optional to fill. |

## Create Google Cloud Storage credentials

Expand Down Expand Up @@ -82,6 +82,7 @@ Please note that we only support Service Account HMAC key authorization, means i
2. Next, create a new service account for the Adapty by clicking on the "+ CREATE SERVICE ACCOUNT" button.



<Zoom>
<img src={require('./img/98f8ebf-CleanShot_2023-03-17_at_15.40.062x.webp').default}
style={{
Expand All @@ -99,6 +100,7 @@ Please note that we only support Service Account HMAC key authorization, means i
3. Fill out the fields in the first step, as access will be granted at a later stage. In order to read more details about this page read the documentation [here](https://cloud.google.com/iam/docs/service-accounts-create).



<Zoom>
<img src={require('./img/2190c50-CleanShot_2023-03-17_at_15.48.552x.webp').default}
style={{
Expand All @@ -116,6 +118,7 @@ Please note that we only support Service Account HMAC key authorization, means i
4. To create and download a [private JSON key](https://cloud.google.com/iam/docs/keys-create-delete), navigate to the KEYS section and click on the "ADD KEY" button.



<Zoom>
<img src={require('./img/8a45468-CleanShot_2023-03-17_at_15.58.092x.webp').default}
style={{
Expand All @@ -133,6 +136,7 @@ Please note that we only support Service Account HMAC key authorization, means i
5. In the DETAILS section, locate the Email value linked to the recently created service account and make a copy of it. This information will be necessary for the upcoming steps to authorize the account and allow it to write to the bucket.



<Zoom>
<img src={require('./img/6ccd0f0-CleanShot_2023-03-17_at_16.03.162x.webp').default}
style={{
Expand All @@ -150,6 +154,7 @@ Please note that we only support Service Account HMAC key authorization, means i
6. To proceed go to the Google Cloud Storage's[ Buckets](https://console.cloud.google.com/storage/browser) page and either select an existing bucket or create a new one to store the Event or Visuts Data reports from Adapty. Then navigate to the PERMISSIONS section and select the option to [GRANT ACCESS](https://support.google.com/cloudidentity/answer/9178892?hl=en).



<Zoom>
<img src={require('./img/3cdd937-CleanShot_2023-03-17_at_16.14.232x.webp').default}
style={{
Expand All @@ -167,6 +172,7 @@ Please note that we only support Service Account HMAC key authorization, means i
7. In the PERMISSIONS section, input the Email of the service account obtained in the fifth step mentioned earlier, then choose the Storage Object Creator role. Finally, click on SAVE to apply the changes.



<Zoom>
<img src={require('./img/62801f4-CleanShot_2023-03-17_at_16.17.312x.webp').default}
style={{
Expand All @@ -186,6 +192,7 @@ Please note that we only support Service Account HMAC key authorization, means i
8. After passing these steps have successfully completed the necessary setup steps in the Google Cloud Console! The final step involves entering the bucket's name, accessing the JSON file containing the downloaded private key, and extracting the required field values for use in Adapty.



<Zoom>
<img src={require('./img/c967e16-CleanShot_2023-03-17_at_16.23.332x.webp').default}
style={{
Expand Down Expand Up @@ -264,7 +271,7 @@ Here is the table structure for the events:
| **idfa** | [advertisingIdentifier](https://developer.apple.com/documentation/adsupport/asidentifiermanager/advertisingidentifier) on iOS devices |
| **advertising_id** | The Advertising ID is a unique code assigned by the Android Operating System that advertisers might use to uniquely identify a user's device |
| **ip_address** | Device IP (can be IPv4 or IPv6, with IPv4 preferred when available). It is updated each time IP of the device changes |
| **cancellation_reason** | <p>A reason why the user canceled a subscription.</p><p></p><p>Can be:</p><p>**iOS & Android**_voluntarily_cancelled_, _billing_error_, _refund_</p><p>**iOS** _price_increase_, _product_was_not_available_, _unknown_, _upgraded_</p><p>**Android** _new_subscription_replace_, _cancelled_by_developer_</p> |
| **cancellation_reason** | <p>A reason why the user canceled a subscription.</p><p></p><p>Can be:</p><p>**iOS & Android**_voluntarily_cancelled_, _billing_error_, _refund_</p><p>**iOS** _price_increase_, _product_was_not_available_, _unknown_, _upgraded_</p><p> **Android** _new_subscription_replace_, _cancelled_by_developer_</p> |
| **android_app_set_id** | An [AppSetId](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/appsetid/AppSetId) - unique, per-device, per developer-account user-resettable ID for non-monetizing advertising use cases. |
| **android_id** | On Android 8.0 (API level 26) and higher versions of the platform, a 64-bit number (expressed as a hexadecimal string), unique to each combination of app-signing key, user, and device. For more details, see [Android developer documentation](https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID). |
| **device** | The end-user-visible device model name. |
Expand Down Expand Up @@ -312,4 +319,3 @@ Below the credentials, there are three groups of events you can export, send, an
/>
</Zoom>


36 changes: 19 additions & 17 deletions versioned_docs/version-3.0/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Each event is wrapped into the following structure:
"event_datetime": "2023-02-18T18:40:22.000000+0000",
"event_properties": <event-specific properties>,
"event_api_version": 1,
"profiles_sharing_access_level": [{"profile_id": "f9e83cb0-0cf3-4e92-b1a4-733311fe5800", "customer_user_id": "[email protected]"}],
"attributions": {"attribution_source1": <attribution_data>, "attribution_source2": <attribution_data>, ...},
"user_attributes": {"attribute_name1": "attribute_value1", "attribute_name2": "attribute_value2", ...}
"integration_ids": {"firebase_app_instance_id": "val1", "branch_id": "val2", "one_signal_player_id": "val3", ... }
Expand All @@ -70,23 +71,24 @@ Each event is wrapped into the following structure:

### Event parameters

| Property | Type | Description |
| :--------------------------- | :------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **profile_id** | String | The Сustomer user ID of the profile in Adapty. |
| **customer_user_id** | String | User ID you use in your app to identify the user. For example, it can be your user UUID, email, or any other ID. Null if you didn't set it. |
| **idfv** | String | The identifier for vendors (IDFV) is a unique code assigned to all apps developed by a single developer, which in this case refers to your apps |
| **idfa** | String | The identifier for advertisers (IDFA) is a random device identifier assigned by Apple to a user's device. |
| **advertising_id** | String | The Advertising ID is a unique code assigned by the Android Operating System that advertisers might use to uniquely identify a user's device. |
| **profile_install_datetime** | ISO 8601 date & time | Installation date and time in format [IOS 8601](https://www.iso.org/iso-8601-date-and-time-format.html): starting with the year, followed by the month, the day, the hour, the minutes, seconds, and milliseconds. For example, 2020-07-10T15:00:00.000000+0000, represents the 10th of July 2020 at 3 p.m. |
| **user_agent** | String | User-agent used by the browser on the device. |
| **email** | String | E-mail of your user. |
| **event_type** | String | Event name as set up in the in the **Events names** section of the [**Integrations** -> **Webhooks**](https://app.adapty.io/integrations/customwebhook) page in lowercase. |
| **event_datetime** | ISO 8601 date & time | Event date and time in format [IOS 8601](https://www.iso.org/iso-8601-date-and-time-format.html) : starting with the year, followed by the month, the day, the hour, the minutes, seconds, and milliseconds. For example, 2020-07-10T15:00:00.000000+0000, represents the 10th of July 2020 at 3 p.m. |
| **event_properties** | JSON | JSON of [event properties](events#properties). |
| **event_api_version** | Integer | Adapty API version. The current value is `1`. |
| **attributions** | JSON | JSON of [attribution data](webhook#attribution-data). |
| **user_attributes** | JSON | JSON of [custom user attributes](setting-user-attributes#custom-user-attributes). |
| **integration_ids** | JSON | JSON of user integration identifiers. If a user doesn't have any identifier or integrations are disabled, then a null is sent. |
| Property | Type | Description |
| :-------------------------------- | :------------------- | :----------------------------------------------------------- |
| **profile_id** | String | The Сustomer user ID of the profile in Adapty. |
| **customer_user_id** | String | User ID you use in your app to identify the user. For example, it can be your user UUID, email, or any other ID. Null if you didn't set it. |
| **idfv** | String | The identifier for vendors (IDFV) is a unique code assigned to all apps developed by a single developer, which in this case refers to your apps |
| **idfa** | String | The identifier for advertisers (IDFA) is a random device identifier assigned by Apple to a user's device. |
| **advertising_id** | String | The Advertising ID is a unique code assigned by the Android Operating System that advertisers might use to uniquely identify a user's device. |
| **profile_install_datetime** | ISO 8601 date & time | Installation date and time in format [IOS 8601](https://www.iso.org/iso-8601-date-and-time-format.html): starting with the year, followed by the month, the day, the hour, the minutes, seconds, and milliseconds. For example, 2020-07-10T15:00:00.000000+0000, represents the 10th of July 2020 at 3 p.m. |
| **profiles_sharing_access_level** | JSON | <p> A list of objects, each containing the IDs of users who share the access level (including the current profile):</p><ul> <li> **profile_id**: (UUID4) The Adapty Profile ID sharing the access level, including the current profile.</li> <li> **customer_user_id**: (string) The Customer User ID, if provided.</li> </ul> <p>This is used when the [**Sharing paid access between user accounts**](general#6-sharing-purchases-between-user-accounts) parameter is set to share an access level.</p> |
| **user_agent** | String | User-agent used by the browser on the device. |
| **email** | String | E-mail of your user. |
| **event_type** | String | Event name as set up in the in the **Events names** section of the [**Integrations** -> **Webhooks**](https://app.adapty.io/integrations/customwebhook) page in lowercase. |
| **event_datetime** | ISO 8601 date & time | Event date and time in format [IOS 8601](https://www.iso.org/iso-8601-date-and-time-format.html) : starting with the year, followed by the month, the day, the hour, the minutes, seconds, and milliseconds. For example, 2020-07-10T15:00:00.000000+0000, represents the 10th of July 2020 at 3 p.m. |
| **event_properties** | JSON | JSON of [event properties](events#properties). |
| **event_api_version** | Integer | Adapty API version. The current value is `1`. |
| **attributions** | JSON | JSON of [attribution data](webhook#attribution-data). |
| **user_attributes** | JSON | JSON of [custom user attributes](setting-user-attributes#custom-user-attributes). |
| **integration_ids** | JSON | JSON of user integration identifiers. If a user doesn't have any identifier or integrations are disabled, then a null is sent. |

:::warning
Note that this structure may grow over time — with new data being introduced by us or by the 3rd parties we work with. Make sure that your code that processes it is robust enough and relies on the specific fields, but not on the structure as a whole.
Expand Down

0 comments on commit 394eb75

Please sign in to comment.