Event analytics

You can use this feature if you have already integrated Pay Station and set up at least one account: Google Analytics, Facebook Ads/Facebook Analytics, or AppsFlyer.

Notice

Google Analytics and Facebook collect data if a user gave their permission to use all cookies or consented to use analytical and performance cookies on the GDPR banner.

Integration with analytics platforms

Connecting Google Analytics, Facebook Pixel, and AppsFlyer in your Publisher Account allows you to track events happening in Pay Station when users interact with it.

You can track the following events:

Google Analytics

To connect the analytics platform:

  1. Open your project in Publisher Account.
  2. Go to Pay Station > Settings.
  3. In the Apps section, choose Google Analytics.
  4. Click Connect.

When you connect Google Analytics, the correspondent events will be sent to your Google Analytics account. You can find these events in Google Analytics in Behaviour > Events > Top Events.

You can track the following events:

ActionDescription
open-{state_name}Opening a page in the payment UI.
click-btn-payClicking the Pay Now button on the billing data entry form.
returnClicking the Return to Store/Start again button.
create-invoiceTransaction creation.
open-payment-credit-cardOpening payment UI to enter card details.
open-payment-saved-methodsOpening the page with saved payment methods.
open-payment-payment-methodsOpening the list of all available payment methods when clicking more.
open-payment-{id}Opening the page of a particular payment method, where id is a payment method ID.
open-statusOpening the page of a payment status.
open-status-processingOpening a page with a processing payment status. After processing is completed, the status can change to success or error.
open-status-errorOpening a page with an error payment status.
open-status-successOpening a page with a success payment status.
choose-methodChoosing a payment method when opening the more list.
Custom dimensions for Google Analytics
DimensionNameDescription
1versionPay Station version.
2purchase_invoice_idPayment invoice ID in the Xsolla system.
3external_idPayment invoice ID in the partner’s system.
4purchase_skuSKU of the purchased item.
5total_sumTotal purchase amount. All fees are included.
6total_sum_currencyTotal purchase amount currency.
7pidID of the payment system.
8projectIdProject ID.
9countryPayment country.
10projectNameName of the project.
12purchase_sku_digitalContentSKU of the purchased game keys package.

Facebook Analytics

To connect the analytics platform:

  1. Open your project in Publisher Account.
  2. Go to Pay Station > Settings.
  3. In the Apps section, choose Facebook Pixel.
  4. Click Connect.

When you connect Facebook Pixel, the correspondent events will be sent to your Facebook Analytics account. You can find these events in Facebook Analytics in Business Settings > Measure & Report > Analytics > Pixels > Overview.

You can track the following events:

EventDescription
open-{state_name}Opening a page in the payment UI. The state name is passed in parameters.
click-btn-payClicking the Pay Now button on the billing data entry form. The payment method name is passed in parameters.
returnClicking the Return to Store/Start again button. The status name is passed in parameters.
change-status-{status_name}Changing the payment status.
If the user closes the payment UI or leaves the page, and then the status changes, the event message is not sent.
create-invoiceTransaction creation.
open-payment-credit-cardOpening payment UI to enter card details.
open-payment-saved-methodsOpening the page with saved payment methods.
open-payment-payment-methodsOpening the list of all available payment methods when clicking more.
open-payment-{id}Opening the page of a particular payment method, where id is a payment method ID.
open-statusOpening the page of a payment status.
open-status-processingOpening a page with a processing payment status. After processing is completed, the status can change to success or error.
open-status-errorOpening a page with an error payment status.
open-status-successOpening a page with a success payment status.
choose-methodChoosing a payment method when opening the more list.

To integrate the analytics platform:

  1. Go to your Publisher Account > Pay Station > Settings.
  2. Select Google Analytics/Facebook Pixel from the Apps section.
  3. Insert your tracking ID and click Connect.

When you integrate Google Analytics and Facebook Pixel, the correspondent events will be sent to your Google Analytics and Facebook Analytics accounts.

AppsFlyer

To connect the analytics platform:
  1. Open your project in Publisher Account.
  2. Go to Pay Station > Settings.
  3. In the Apps section, choose AppsFlyer.
  4. Click Connect.
  1. In the AppsFlyer Dev Key field, enter the developer key. You can find this information in your account in AppsFlyer:
    1. Go to the My Apps section.
    2. Click View brand bundles.
    3. In the line of a corresponding brand bundle, click the copy icon in the Web dev key column.
  1. Click Connect.
To find information about events in your account in AppsFlyer:
  1. Go to the My Apps section.
  2. In the Available Apps section, choose an app you need and click View in PBA.

Example of displaying of collected analytics events:

You can also see the analytics events in the Dashboards > People-Based Attribution section. You can track the following events:

EventDescription
xs-open-{state_name}Opening a page in the payment UI. The state name is passed in parameters.
xs-click-btn-payClicking the Pay Now button on the billing data entry form. The payment method name is passed in parameters.
xs-click-btn-return-urlClicking the Back to the game button in the payment status page.
xs-change-status-{status_name}Changing the payment status.
If the user closes the payment UI or leaves the page, and then the status changes, the event message is not sent.
xs-create-invoiceTransaction creation.
xs-open-payment-credit-cardOpening payment UI to enter card details.
xs-open-payment-saved-methodsOpening the page with saved payment methods.
xs-open-payment-payment-methodsOpening the list of all available payment methods when clicking more.
xs-open-payment-{id}Opening the page of a particular payment method, where id is a payment method ID.
xs-open-statusOpening the page of a payment status.
xs-open-status-processingOpening a page with a processing payment status. After processing is completed, the status can change to success or error.
xs-open-status-errorOpening a page with an error payment status.
xs-open-status-successOpening a page with a success payment status.
xs-choose-methodChoosing a payment method when opening the more list.

Payment UI events

Payment interface events are processed via the postMessage mechanism when opening Pay Station in an iframe, new window or with Pay Station Embed.

Example of scenario for processing messages sent via postMessage:

  1. Subscribe to receive messages sent via postMessage.
  2. Parse the data for the event into a JSON format.
  3. Implement a check for the presence of the event that needs to be processed.
  4. When the required event is received, implement the logic for processing it. In the example below, the text is output to the console. You can add your own logic.

Example:
Copy
Full screen
Small screen
    window.addEventListener('message', (event) => {
      const eventData = JSON.parse(event.data);
    
      if (eventData.command === 'open-payment') {
        console.log('hello!')
      }
    });
    
    EventDescription
    add_saved_accountSuccessful saving of a payment account.
    add_saved_account_errorError occuring while saving a payment account.
    cancel_save_accountCancellation of the saving of a payment account by a user.
    cart_displayDisplaying of the payment UI as columns. The value parameter can be:
    • 1 if the payment UI opens as two columns
    • 0 if the payment UI opens as a column, e.g., on the page where you manage saved payment methods
    Example: {“command”:“cart_display”,“data”:{“value”:“1”,“version”:“Pay Station 4”}}.
    change-statusChanging the payment status. If the user closes the payment UI or leaves the page, and then the status changes, the event message is not sent.
    choose-methodChoosing a payment method when opening the more list.
    click-custom-package-continueClicking the Continue button when buying an arbitrary amount of virtual currency.
    click-commentClicking the button to post a comment.
    click-buy-packageClicking the Buy Package button when buying a package of virtual currency.
    click-buy-gift-packageClicking the button when buying a package of virtual currency as a gift.
    click-buy-gift-custom-packageClicking the button when buying an arbitrary amount of virtual currency as a gift.
    click-btn-payClicking the Pay Now button on the billing data entry form.
    click-btn-continueClicking the button to buy the subscription.
    click-btn-applyClicking the Apply button when redeeming a coupon.
    click-btn-activateClicking the Activate button when activating a game key.
    click-btn-acceptClicking the button to buy digital content.
    create-invoiceTransaction creation.
    dimensionsWhen Pay Station opens in the iframe, the width and height of the iframe are passed in the width and height parameters.
    errorAn error that occurs during the payment process. The error code is passed in the data.code parameter, and the error description in the payment UI is passed in the data.message parameter.
    external-link-openRedirection to an external resource. The address to which the redirection occurred is passed in the url parameter.
    external-payment-openRedirection from the payment UI to an external payment system or 3-D Secure verification.
    focus-changeChanging the focus on elements of the Pay Station widget. The focus state is passed in the hasFocus parameter and can be true or false.
    open-{state_name}Opening a page in the payment UI.
    open-payment-credit-cardOpening payment UI to enter card details.
    open-payment-saved-methodsOpening the page with saved payment methods.
    open-payment-payment-methodsOpening the list of all available payment methods when clicking more.
    open-payment-{id}Opening the page of a particular payment method, where id is a payment method ID.
    open-statusOpening the page of a payment status.
    open-status-processingOpening a page with a processing payment status. After processing is completed, the status can change to success or error.
    open-status-errorOpening a page with an error payment status.
    open-status-successOpening a page with a success payment status.
    order-statusChanging the order status to done. The event is sent from the payment status page if an order was created via one of the following API calls:
    Data about a user, transaction, and order are passed in the data object.

    Example: {“command”:“order-status”,“data”:{“user_id”:“123abc-456”,“invoice_id”:123456,“price”:{“amount”:“12.96”,“currency”:“USD”},“order_id”:123456,“items”:[{“id”:123456,“sku”:“booster_min”,“quantity”:2,“amount”:“3.99”,“price”:{“amount”:“3.99”,“currency”:“USD”},“tax_category”:“DG00001”},{“id”:123456,“sku”:“boots_1”,“quantity”:1,“amount”:“2.99”,“price”:{“amount”:“2.99”,“currency”:“USD”},“tax_category”:“DG00001”},{“id”:1234567,“sku”:“xsolla_gloves”,“quantity”:1,“amount”:“1.99”,“price”:{“amount”:“1.99”,“currency”:“USD”},“tax_category”:“DG00001”},{“id”:12345678,“sku”:“reward_vp_a”,“quantity”:5,“amount”:“0”,“price”:{“amount”:“0”,“currency”:“USD”},“tax_category”:“DG00001”}],“version”:“Pay Station 4”}}.
    resizeChanging the payment UI size. The width and height of the opened payment UI are passed in the data object.
    Example: {“command”:“resize”,“data”:{“dimensions”:{“width”:924,“height”:754},“version”:“Pay Station 4”}}.
    show-error-pageOpening a page with an error. An error code is passed in value parameter.
    statusGoing to the payment status page. The following parameters can be passed:
    • status — payment status
    • email — user’s email
    • invoice — transaction ID
    • virtualCurrencyAmount — the amount of purchased virtual currency
    • userId — user ID
    • discount — the discount applied to the payment
    status-redeemThe coupon redemption in a payment form.
    closeClosing the payment UI.
    The event parameters are passed in each message from postMessage. If the parameter information has not been collected yet, an empty string displays.
    ParameterTypeDescription
    actionstringEvent name.
    valuestringAdditional parameter. Contains specific event parameters that vary depending on the user’s choice.
    statestringThe payment UI page, on which the action was performed.
    datestringDate and time in the GMT format.
    millisecondsnumberDate and time in the Unix time format.
    timezonestringUser time zone.
    session_idstringSession ID. The session includes all user actions performed within 30 minutes or until the payment UI is closed. The session starts from the moment when the payment UI is opened and is saved after the page with the payment UI is refreshed.
    payment_countrystringPayment country.
    purchase_invoice_idnumberPayment invoice ID in the Xsolla system.
    purchase_external_idstringPayment invoice ID in the partner’s system.
    purchase_typestringPurchase type. Can be: virtual item, virtual currency, pay2play, subscription.
    purchase_sumnumberNominal purchase amount.
    purchase_currencystringPurchase currency.
    purchase_skustringSKU of the purchased item.
    purchase_digital_content_skustringSKU of the purchased game keys package.
    purchase_descriptionstringPurchase description.
    virtual_currency_amountnumberVirtual currency amount.
    coupon_codestringCoupon code.
    subscription_package_external_idnumberSubscription ID.
    subscription_package_namestringSubscription name.
    subscription_package_descriptionstringSubscription description.
    total_sumnumberTotal purchase amount. All fees are included.
    total_sum_currencystringTotal purchase amount currency.
    user_idstringUser ID (v1).
    user_countrystringUser country.
    payment_instance_namestringPayment method name.
    Events are linked to the pages where the user performs all actions when purchasing an item.
    StateDescription
    cartPage with the selected item purchased in virtual currency and a purchase confirmation.
    couponCoupon entry form.
    giftcardPage with the gift cards list (Gift Cards widget).
    giftrecipientGift purchase page.
    historyPurchase history page.
    indexService page, to which the user is redirected after opening the application. It is not shown to the user.
    legalMobile version of the page with links to legal documents.
    listList of payment methods.
    paybycashPage with the list of payment methods for purchasing via cash kiosks (Pay with Cash widget).
    paymentPayment form.
    paymentaccountPage with the saved payment accounts.
    paymentreturnService page, to which the user is redirected after the payment is made, and from which the user is sent to the status page. It is not shown to the user.
    pincartPage with the list of digital content platforms.
    pricepointVirtual currency store.
    savedmethodList of saved payment methods.
    shippingaddressDelivery address form.
    statusStatus page.
    subscriptionSubscription plans store.
    subscriptionchangeSubscription plan change.
    useraccountAccount information page (username, balance) with the Disable confirmation screen for future item purchases setting.
    userinventoryUser inventory.
    usermenuMobile version of the user menu page.
    usersubscriptionUser subscriptions management.
    usersubscriptioninfoSubscription details page.
    virtualitemVirtual items store.

    To send events to your Google Analytics and Facebook Analytics accounts, you need to integrate these analytics platforms.
    Was this article helpful?
    Thank you!
    Is there anything we can improve? Message
    We’re sorry to hear that
    Please explain why this article wasn’t helpful to you. Message
    Thank you for your feedback!
    We’ll review your message and use it to help us improve your experience.
    Rate this page
    Rate this page
    Is there anything we can improve?

    Don’t want to answer

    Thank you for your feedback!
    Last updated: April 1, 2024

    Found a typo or other text error? Select the text and press Ctrl+Enter.

    Report a problem
    We always review our content. Your feedback helps us improve it.
    Provide an email so we can follow up
    Thank you for your feedback!