Shopify / checkout-sheet-kit-react-native

Shopify's Checkout Sheet Kit for React Native - simplifying the process of adding checkout to your native apps.
https://shopify.dev/docs/custom-storefronts/mobile-apps
MIT License
30 stars 3 forks source link

Properties omitted from the Pixel events #109

Closed BARK-AHAAS closed 1 month ago

BARK-AHAAS commented 1 month ago

Description

I am currently leveraging thepixel event listener to send events to Rudderstack so that I can create charts to compare performance to our web Storefront.

Below is how products come back on the Rudderstack Shopify web integration:

            {
                "applied_discounts": [],
                "brand": "BARK",
                "compare_at_price": "35.00",
                "destination_location_id": null,
                "fulfillment_service": "manual",
                "gift_card": false,
                "grams": 454,
                "key": "48121566986515",
                "line_price": "31.00",
                "origin_location_id": null,
                "presentment_title": "BarkBox 12 Month Subscription",
                "presentment_variant_title": "Medium Dog / Yes Allergies / Yes Extra Toys (+$9)",
                "price": "31.00",
                "product_id": 8918466461971,
                "properties": {
                    "Dog's Name": "TESTING",
                    "_product_type": "Box",
                    "_selling_plan": "690344034579",
                    "_subscription": "true"
                },
                "quantity": 1,
                "rank": null,
                "requires_shipping": true,
                "sku": "BB-A-X-M-LN",
                "tax_lines": [],
                "taxable": true,
                "title": "BarkBox 12 Month Subscription",
                "unit_price_measurement": {
                    "measured_type": null,
                    "quantity_unit": null,
                    "quantity_value": null,
                    "reference_unit": null,
                    "reference_value": null
                },
                "user_id": null,
                "variant": "48121566986515 31.00 Medium Dog / Yes Allergies / Yes Extra Toys (+$9)"
            },

and this is how products come through in the pixel event:

        {
          "variant": {
            "product": {
              "url": "/products/barkbox-12-month-v2",
              "id": "8918466461971",
              "vendor": "BARK",
              "type": "Box",
              "untranslatedTitle": "BarkBox 12 Month Subscription",
              "title": "BarkBox 12 Month Subscription"
            },
            "id": "48121566986515",
            "sku": "BB-A-X-M-LN",
            "price": {
              "amount": 31,
              "currencyCode": "USD"
            },
            "title": "Medium Dog / Yes Allergies / Yes Extra Toys (+$9)",
            "untranslatedTitle": "Medium Dog / Yes Allergies / Yes Extra Toys (+$9)",
            "image": {
              "src": "https://cdn.shopify.com/s/files/1/0840/3409/3331/products/MAR_BB_PDP-01_64x64.png?v=1709673404"
            }
          },
          "title": "BarkBox 12 Month Subscription",
          "quantity": 1,
          "id": "48121566986515",
          "discountAllocations": []
        },

I am currently writing logic to parse the pixel event to mach the shape of the web event but I am running into cases where data is omitted from the pixel event - most notably:

It would be very helpful if the data returned in the pixel event matched the data returned in the web event so that comprable dashboards / reporting can be created across the 2 platforms.

Rationale

Some of these omitted values are essential to gaining a full scope of the products that customer's are checking out with and adding them to the pixel event would increase the impact of reports created leveraging the checkout-sheet-kit-react-native library's built in event.

kiftio commented 1 month ago

We are a little behind the latest web-pixel schema.

However, it looks as though Rudderstack are augmenting standard event data and have introduced their own product schema.

Here's an example standard event and what the schema looks like (the relevant part of the schema is the data.lineItems attribute) https://shopify.dev/docs/api/web-pixels-api/standard-events/payment_info_submitted

So we can add properties. But it doesn't look like requires_shipping, compare_at_price, grams, gift_card, rank etc. are available.

I haven't looked into how Rudderstack works, If they subscribe to standard events, augment them with this additional data, and emit new custom events, you should be able to listen for the custom events in the same pixel event callback.

If they don't emit custom events. It'd probably be a web pixels feature request to update the product schema.

If you want information around whether the product was actually bought with a gift card, or was shipped / picked up, you could look at other parts of the standard event schema (transactions, discountApplications, delivery - we'll make sure these attributes are up to date ASAP).

BARK-AHAAS commented 1 month ago

Totally makes sense. After reviewing the available items provided in the web-pixel schema and discussing with my PM the ones of highest concern are:

One thing i also noticed is that these note they are only available if you have updated to Checkout Extensibility, which our shop has. Not sure if there is something additional i need to do with the SDK to trigger these or if they will just be picked up once the code is updated on your end?

kiftio commented 1 month ago

No, I don't think you'll need to do anything else to get those attributes