HomeGuidesChangelogDiscussions
Log In
Guides

UI / SDK events attributes

This section provides details on the UI / SDK events attributes

Events properties

Attribute

Mandatory

Description

sdk_version

Yes

string

Contains the SDK version.

This attribute will be filled for all events.

event_name

Yes

string

Contains the name of the event.
See the full list of SDK / UI Events

event_created_at_ms

Yes

int
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_at

Yes

string
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_id

No

string

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_id

No

string

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_presentation

No

string

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

This attribute will be filled for everyUI & User Behavior events

placement_id

No

string

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

This attribute will only be filled forUI & User Behavior events

audience_id

No

string

Contains the Audience ID matched for the user.

*This attribute will only be filled forUI & User Behavior events *

ab_test_id

No

string

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

This attribute will only be filled forUI & User Behavior events

ab_test_variant_id

No

string

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

*This attribute will only be filled forUI & User Behavior events *

content_id

No

string

Contains the Content ID provided by the App.

deeplink_identifier

No

string

Contains the deeplink used to display the Screen if any.

*This attribute will only be filled forUI & User Behavior events *

purchasable_plans

No

  • *Array of Plans** (object described here)

Contains all the Plans that are displayed in the Screen.

This attribute will be filled for everyUI & User Behavior events

link_identifier

No

string

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

*This attribute will only be filled for the eventLINK_OPENED *

carousels

No

  • *Array of carousels** (object described here)

Contains all attributes for all displayed carousels in the Screen.

*This attribute will only be filled forUI & User Behavior events if the Screen contains at least one carousel *

language

No

string
in ISO 639-1

Contains the language used in the displayed Screen.

This attribute will be filled for everyUI & User Behavior events

device

Yes

string

Contains the device model used by the user.

os_version

Yes

string

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

type

Yes

string

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

  • PHONE
  • TABLET
  • TV

error_message

No

string

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 _

plan

No

string

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

selected_presentation

No

string

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

This attribute will be filled forOPEN_PRESENTATION and SELECTED_PRESENTATION

previous_selected_presentation

No

string

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

This attribute will be filled forOPEN_PRESENTATION and SELECTED_PRESENTATION

selected_product

No

string

Contains the Product ID that is selected.

This attribute will be filled forSUBSCRIPTION_DETAILS_VIEWED event.

plan_change_type

No

string

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

  • CROSSGRADE
  • DOWNGRADE
  • UPGRADEThis attribute will be filled forSUBSCRIPTION_PLAN_TAPPED event

running_subscriptions

No

Array 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_id

No

string

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

That attribute will be filled forCANCELLATION_REASON_PUBLISHED event

cancellation_reason

No

string

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

This attribute will be filled forCANCELLATION_REASON_PUBLISHED event

selected_options

NO

string

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

  • This attribute will be filled for OPTIONS_SELECTED and OPTIONS_VALIDATED events

selected_option_id

NO

string

Contains the Option Id as set in the Screen Composer for a plan picker, survey, faq or switch component.

This attribute will be filled forOPTIONS_SELECTED and OPTIONS_VALIDATED events

selected_options

NO

Array of Strings

Contains options selected (event OPTIONS_SELECTED) or validated (event OPTIONS_VALIDATED) by the user. The values provided match with the options configured in the Screen Composer.

This attribute will be filled forOPTIONS_SELECTED and OPTIONS_VALIDATED events

displayed_options

NO

Array of Strings

List of options values displayed to the user. The values provided match with the options configured in the Screen Composer.

This attribute will be filled forOPTIONS_SELECTED and OPTIONS_VALIDATED events


Plans

Attribute

Description

type

string

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_id

string

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

store

string

Contains the store on which is available one of the available plan.

store_country

string
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_id

string

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_currency

float

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

customer_currency

string
in ISO 4217

Contains the customer currency code.

period

string

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

duration

int

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_currency

float

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_period

string

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_duration

int

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_trial

bool

True if a free trial is available for the plan.

free_trial_period

string

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_duration

int

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_referent

string

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

discount_percentage_comparison_to_referent

string

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

discount_price_comparison_to_referent

float

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

is_default

bool

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


Carousels

Attribute

Description

selected_slide

int

Contains the number of the current selected slide.

number_of_slides

int

Contains the total number of slides of the carousel.

is_carousel_auto_playing

bool

true if the carousel's slides switch automatically.

default_slide

int

Contains the number of the default selected slide.

previous_slide

int

Contains the number of the previously selected slide.

That attribute will only be filled for the event CAROUSEL_SLIDE_SWIPED.


Surveys

The following properties are only set for the events OPTIONS_SELECTED and OPTIONS_VALIDATED which are triggered when users interact with a Survey (Multiple Choice Component) or a Switch Component.

Attribute

Description

selected_option_id

string

Contains the Survey ID.

selected_options

Array of Strings

Contains answers selected (event OPTIONS_SELECTED) or validated (event OPTIONS_VALIDATED) by the user. The values provided match with the Answers values configured.

displayed_options

Array of Strings

List of Answers values displayed to the user. The values provided match with the Answers values configured.

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",
  "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",
  "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",
  "running_subscriptions" : [
    {
      "plan" : "PURCHASELY_PLUS_MONTHLY",
      "product" : "PURCHASELY_PLUS"
    }
  ],
  "plan_change_type" : "UPGRADE"
}
{
  "event_created_at_ms_original": 1728564123906,
  "session_count": 34,
  "template": "COMPOSER",
  "language": "en",
  "displayed_presentation": "tc_nico",
  "event_created_at_original": "2024-10-10T12:42:03.906Z",
  "device": "iPhone14,2",
  "session_id": "3FFF09CC-25FF-4F6B-B089-C43DB068FE06",
  "type": "PHONE",
  "presentation_type": "NORMAL",
  "event_created_at_ms": 1728564123907,
  "os_version": "iOS 18.0",
  "session_duration": 747,
  "sdk_version": "5.0.0",
  "event_created_at": "2024-10-10T12:42:03.907Z",
  "app_installed_at_ms": 1727858985920,
  "is_fallback_presentation": false,
  "anonymous_user_id": "D2C2CE73-F5F0-4A27-A945-000635CFE39B",
  "app_installed_at": "2024-10-02T08:49:45.920Z",
  "event_name": "OPTIONS_VALIDATED",
  "user_id": "nico",
  "screen_duration": 339,
  "name": "OPTIONS_VALIDATED",
  "selected_option_id": "survey_1", // ID of the survey
  "selected_options": [
    "reponse_b",
    "reponse_c"
  ],																// Answers picked up by the user
  "displayed_options": [
    "reponse_a",
    "reponse_b",
    "reponse_c",
    "reponse_d",
    "reponse_e"
  ]																	// Answers displayed to the user
}