UI / SDK events attributes

This section provides details on the UI / SDK events attributes

Events properties

AttributeMandatoryDescription
sdk_versionYesstring

Contains the SDK version.

This attribute will be filled for all events.
event_nameYesstring

Contains the name of the event.
See the full list of SDK / UI Events
event_created_at_msYesint
in milliseconds since the Epoch

Contains the date which the event was sent the first time. In case of retry that attribute will still be set with the time at the first try.
event_created_atYesstring
in ISO 8601

Contains the date which the event was sent the first time. In case of retry that attribute will still be set with the time at the first try.
user_idNostring

Contains the user_id associated to the Connected User when they are logged-in.

This attribute or the anonymous_user_id will be filled for all events
anonymous_user_idNostring

Contains the anonymous_user_id associated to the Anonymous User when they are not logged-in (anonymous then)

This attribute or the user_id will be filled for all events
displayed_presentationNostring

Contains the Presentation ID (field ID in the Purchasely Screen & Paywall Builder) that was displayed to the user.

This attribute will be filled for every UI & User Behavior events
placement_idNostring

Contains the Placement ID from where the presentation was triggered if any.

This attribute will only be filled for UI & User Behavior events
ab_test_idNostring

Contains the AB test ID if the Event was triggered within an A/B Test.

This attribute will only be filled for UI & User Behavior events
variant_idNostring

Contains the AB test variant ID if the Event was triggered within an A/B Test.

This attribute will only be filled for UI & User Behavior events
deeplink_identifierNostring

Contains the deeplink used to display the Screen if any.

This attribute will only be filled for UI & User Behavior events
purchasable_plansNoArray of Plans (object described here)

Contains all the Plans that are displayed in the Screen.

This attribute will be filled for every UI & User Behavior events
selected_planNostring

Contains the Plan ID of the selected Plan if any (field ID of the Plan in the Purchasely Console)

This attribute will only be filled for UI & User Behavior events
previous_selected_planNostring

Contains the Plan ID of the previously selected Plan if any (field ID of the Plan in the Purchasely Console)

This attribute will only be filled for the event PLAN_SELECTED
link_identifierNostring

Contains the url of the link the user just tapped on.

This attribute will only be filled for the event LINK_OPENED
carouselsNoArray of carousels (object described here)

Contains all attributes for all displayed carousels in the Screen.

This attribute will only be filled for UI & User Behavior events if the Screen contains at least one carousel
languageNostring
in ISO 639-1

Contains the language used in the displayed Screen.

This attribute will be filled for every UI & User Behavior events
deviceYesstring

Contains the device model used by the user.
os_versionYesstring

Contains the OS version running on the user's device.
typeYesstring

Contains the type of device used by the user.
Possible values:

- PHONE
- TABLET
- TV
error_messageNostring

Contains the error message the store returned when trying the action.

_That attribute will be filled for the events:

- IN_APP_PURCHASE_FAILED
- IN_APP_NOT_AVAILABLE
- RESTORE_FAILED
- RECEIPT_FAILED _
planNostring

Contains the Plan ID of the Plan associated to the action if any (field ID of the Plan in the Purchasely Console)

_This attribute will be filled for events:

- In-App Purchase Flow
- Restore
- Receipts
- SUBSCRIPTION_CANCELLED_TAPPED
- SUBSCRIPTION_PLAN_TAPPED
selected_presentationNostring

Contains the currently selected Screen ID (field ID in the Screen & Paywall Builder).

This attribute will be filled for OPEN_PRESENTATION and SELECTED_PRESENTATION
previous_selected_presentationNostring

Contains the previously selected Screen ID (field ID in the Screen & Paywall Builder).

This attribute will be filled for OPEN_PRESENTATION and SELECTED_PRESENTATION
selected_productNostring

Contains the Product ID that is selected.

This attribute will be filled for SUBSCRIPTION_DETAILS_VIEWED event.
plan_change_typeNostring

Contains the type of plan change the user did.
Possible values:

- CROSSGRADE
- DOWNGRADE
- UPGRADEThis attribute will be filled for SUBSCRIPTION_PLAN_TAPPED event
running_subscriptionsNoArray of string

Contains pairs of Plan ID and Product ID for each active subscriptions the users has.

This attribute will be filled for every SDK events
cancellation_reason_idNostring

Contains the ID of the reason the user answered through the cancellation survey triggered with Purchasely.

That attribute will be filled for CANCELLATION_REASON_PUBLISHED event
cancellation_reasonNostring

Contains the reason the user answered through the cancellation survey displayed by the Purchasely SDK.

This attribute will be filled for CANCELLATION_REASON_PUBLISHED event


Plans

AttributeDescription
typestring

Contains the string representation of the type of plan of one of the available plan.

Possible values:

- CONSUMABLE
- NON_CONSUMABLE
- NON_CONSUMABLE
- AUTO_RENEWING_SUBSCRIPTION
- NON_RENEWING_SUBSCRIPTION
purchasely_plan_idstring

Contains the Plan ID of one of the purchasable Plan
(field ID of the Plan in the Purchasely Console)
storestring

Contains the store on which is available one of the available plan.
store_countrystring
in ISO 3166

Contains the store country to which the user store account is associated
E.g.: US for an iOS user which Apple ID was created on the US App Store
store_product_idstring

Contains the Product ID associated to the In-App Purchase or In-App Subscription in the store console (App Store Connect or Google Play Console)
price_in_customer_currencyfloat

Contains the standard price in the customer currency for one the available plan.
customer_currencystring
in ISO 4217

Contains the customer currency code.
periodstring

Contains the string representation of the standard period of one of the available plan

Possible values:

- DAY
- WEEK
- MONTH
- YEARThis attribute will be filled only if the "type" of the corresponding Plan is AUTO_RENEWING_SUBSCRIPTION and NON_RENEWING_SUBSCRIPTION
durationint

Contains the string representation of the number "period" of the standard periodicity of one of the available Plan. To get the standard periodicity of the plan you have to concatenate "duration" and "period".

This attribute will be filled only if the "type" of the corresponding plan is AUTO_RENEWING_SUBSCRIPTION and NON_RENEWING_SUBSCRIPTION
intro_price_in_customer_currencyfloat

Contains the introductory offer price in the customer currency for one the available Plan.

That attribute will be filled only if the Plan has a introductory offer available.
intro_periodstring

Contains the string representation of the introductory offer period of one of the available plan

Possible values:

- DAY
- WEEK
- MONTH
- YEARThis attribute will be filled only if the "type" of the corresponding Plan is AUTO_RENEWING_SUBSCRIPTION and NON_RENEWING_SUBSCRIPTION only if the Plan has an introductory offer available.
intro_durationint

Contains the string representation of the number "period" of the introductory offer periodicity of one of the available Plan. To get the introductory offer periodicity of the Plan you have to concatenate "duration" and "period".

This attribute will be filled only if the "type" of the corresponding Plan is AUTO_RENEWING_SUBSCRIPTION and NON_RENEWING_SUBSCRIPTION" only if the Plan has an introductory offer available.
has_free_trialbool

True if a free trial is available for the plan.
free_trial_periodstring

Contains the string representation of the free trial offer period of one of the available Plans

Possible values:

- DAY
- WEEK
- MONTH
- YEARThis attribute will be filled only if the "type" of the corresponding Plan is AUTO_RENEWING_SUBSCRIPTION and NON_RENEWING_SUBSCRIPTION only if the Plan has an free trial offer available.
free_trial_durationint

Contains the string representation of the number "period" of the free trial offer periodicity of one of the available Plan. To get the free trial periodicity of the plan you have to concatenate "duration" and "period".

This attribute will be filled only if the "type" of the corresponding Plan is AUTO_RENEWING_SUBSCRIPTION and NON_RENEWING_SUBSCRIPTION only if the Plan has an free trial offer available.
discount_referentstring

Contains the Plan ID of the Plan that is used on the presentation to make a pricing comparison.
discount_percentage_comparison_to_referentstring

Contains the percentage of discount the Plan offers in comparison to the referent.
discount_price_comparison_to_referentfloat

Contains the price difference between, the Plan and the referent.
is_defaultbool

True if the Plan is selected by default in the Screen.

Carousels

AttributeDescription
selected_slideint

Contains the number of the current selected slide.
number_of_slidesint

Contains the total number of slides of the carousel.
is_carousel_auto_playingbool

true if the carousel's slides switch automatically.
default_slideint

Contains the number of the default selected slide.
previous_slideint

Contains the number of the previously selected slide.

That attribute will only be filled for the event CAROUSEL_SLIDE_SWIPED.

Payload sample

{
  "event_name" : "PRESENTATION_VIEWED",
  "event_created_at" : "2021-12-06T10:20:44.818Z",
  "event_created_at_ms" : 1638786044818,
  "device" : "arm64",
  "type" : "PHONE",
  "os_version" : "iOS 16.1.1",
  "sdk_version" : "4.1.0",
  "language" : "en",
  "user_id" : "23DE2D20-7878-414C-B2EC-4B1E632995EB",
  "displayed_presentation" : "YOUR_PAYWALL_ID",
  "template" : "PRES_Y90FJV4M1ZZQF1C8PECVZC3WPMKYUP",
  "selected_plan" : "PURCHASELY_PLUS_MONTHLY",
  "purchasable_plans" : [
    {
      "store_country" : "FRA",
      "price_in_customer_currency" : 40.99,
      "duration" : 1,
      "period" : "YEAR",
      "has_free_trial" : true,
      "free_trial_duration" : 2,
      "free_trial_period" : "MONTH",
      "customer_currency" : "EUR",
      "is_default" : false,
      "type" : "AUTO_RENEWING_SUBSCRIPTION",
      "store" : "APPLE_APP_STORE",
      "purchasely_plan_id" : "PURCHASELY_PLUS_YEARLY",
      "store_product_id" : "com.purchasely.plus.yearly"
    },
    {
      "customer_currency" : "EUR",
      "has_free_trial" : false,
      "duration" : 6,
      "store" : "APPLE_APP_STORE",
      "purchasely_plan_id" : "PURCHASELY_PLUS_6MONTHS",
      "price_in_customer_currency" : 65.99,
      "type" : "AUTO_RENEWING_SUBSCRIPTION",
      "period" : "MONTH",
      "store_product_id" : "com.purchasely.plus.6months",
      "is_default" : false,
      "store_country" : "FRA"
    },
    {
      "is_default" : true,
      "intro_price_in_customer_currency" : 0.49,
      "price_in_customer_currency" : 9.49,
      "intro_period" : "MONTH",
      "type" : "AUTO_RENEWING_SUBSCRIPTION",
      "store_product_id" : "com.purchasely.plus.monthly",
      "intro_duration" : 3,
      "store_country" : "FRA",
      "customer_currency" : "EUR",
      "has_free_trial" : false,
      "period" : "MONTH",
      "purchasely_plan_id" : "PURCHASELY_PLUS_MONTHLY",
      "store" : "APPLE_APP_STORE",
      "duration" : 1
    }
  ],
  "carousels" : [
    {
      "default_slide" : 1,
      "is_carousel_auto_playing" : false,
      "number_of_slides" : 8,
      "selected_slide" : 1
    }
  ]
}
{
  "event_name" : "CAROUSEL_SLIDE_SWIPED",
  "event_created_at" : "2021-12-06T10:20:44.818Z",
  "event_created_at_ms" : 1638786044818,
  "device" : "iPhone13,4",
  "type" : "PHONE",
  "os_version" : "iOS 17.1",
  "sdk_version" : "4.3.0",
  "language" : "en",
  "anonymous_user_id" : "67C77206-F279-4932-B322-69DC4319B517",
  "displayed_presentation" : "YOUR_PAYWALL_ID",
  "template" : "A6F9DC4D-6A90-42B6-BBE9-AA9BA3AFFEFC",
  "selected_plan" : "PURCHASELY_PLUS_MONTHLY",
  "purchasable_plans" : [
    {
      "purchasely_plan_id" : "PURCHASELY_PLUS_YEARLY",
      "is_default" : false,
      "store" : "APPLE_APP_STORE",
      "period" : "YEAR",
      "has_free_trial" : true,
      "store_product_id" : "com.purchasely.plus.yearly",
      "price_in_customer_currency" : 43.99,
      "free_trial_period" : "MONTH",
      "customer_currency" : "USD",
      "store_country" : "USA",
      "free_trial_duration" : 2,
      "type" : "AUTO_RENEWING_SUBSCRIPTION",
      "duration" : 1
    },
    {
      "store_product_id" : "com.purchasely.plus.6months",
      "price_in_customer_currency" : 74.99,
      "store" : "APPLE_APP_STORE",
      "is_default" : false,
      "customer_currency" : "USD",
      "type" : "AUTO_RENEWING_SUBSCRIPTION",
      "duration" : 6,
      "purchasely_plan_id" : "PURCHASELY_PLUS_6MONTHS",
      "store_country" : "USA",
      "period" : "MONTH",
      "has_free_trial" : false
    },
    {
      "is_default" : true,
      "period" : "MONTH",
      "intro_price_in_customer_currency" : 0.49,
      "intro_duration" : 3,
      "duration" : 1,
      "store_product_id" : "com.purchasely.plus.monthly",
      "intro_period" : "MONTH",
      "store_country" : "USA",
      "has_free_trial" : false,
      "type" : "AUTO_RENEWING_SUBSCRIPTION",
      "store" : "APPLE_APP_STORE",
      "customer_currency" : "USD",
      "price_in_customer_currency" : 9.99,
      "purchasely_plan_id" : "PURCHASELY_PLUS_MONTHLY"
    }
  ],
  "carousels" : [
    {
      "previous_slide" : 2,
      "number_of_slides" : 8,
      "default_slide" : 1,
      "selected_slide" : 3,
      "is_carousel_auto_playing" : false
    }
  ]
}
{
  "event_name" : "SUBSCRIPTION_PLAN_TAPPED",
  "event_created_at" : "2021-12-06T10:20:44.818Z",
  "event_created_at_ms" : 1638786044818,
  "device" : "iPhone13,4",
  "type" : "PHONE",
  "os_version" : "iOS 17.1",
  "sdk_version" : "4.3.0",
  "language" : "en",
  "anonymous_user_id" : "23DE2D20-7878-414C-B2EC-4B1E632995EB",
  "displayed_presentation" : "YOUR_PAYWALL_ID",
  "template" : "A6F9DC4D-6A90-42B6-BBE9-AA9BA3AFFEFC",
  "selected_plan" : "PURCHASELY_PLUS_MONTHLY",
  "running_subscriptions" : [
    {
      "plan" : "PURCHASELY_PLUS_MONTHLY",
      "product" : "PURCHASELY_PLUS"
    }
  ],
  "plan_change_type" : "UPGRADE"
}