Tracking
Table of Contents
Revenue tracking
When a user is making an analysis, we recommend products to her/him. To track revenue resulting from these recommendations, each purchase must be checked if it contains a product that was recommended by the analysis.
Whenever a user finishes an analysis and in addition whenever a user opens the result page, we store the recommended products in the local storage of the user's browser (see Local Storage for more details). This information can be used by you to evaluate if a purchase was influenced by a recommendation from Stella by comparing the shopping cart items with the recommended products in the local storage.
You can use this information to build up your own analytics and track the success of our recommendations or push the information to your own platform and we will display the data in our dashboard to the client.
Push purchase information to our platform
Having the information about the purchases, we can evaluate the success of our recommendations and provide our clients with valuable insights on our dashboard.
POST all purchases made in the shop to our API endpoint https://tracking-api-1024057789892.europe-west3.run.app/v1/purchase/createOrder
with the following example JSON payload:
{ "created_at": "2024-02-28T15:08:25-05:00", // ISO 8601 formatted date when the order was placed "id": 5302361555009, // Optional: some internal id in your shop to identify the order "order_number": 1018, // The order number in your shop "currency": "EUR", "line_items": [ // The ordered items { "id": 13109413740609, // Optional: Some internal id to identify this cart item "name": "Dramatic Length Mascara - Brown", // Full name of the purchased product (product name + variant name) "title": "Dramatic Length Mascara", // Product name "variant_title": "Brown", // Variant name "product_id": 7080352251969, // The product id in your shop "variant_id": 40814619394113, // The variant id in your shop "price": "24.00", "quantity": 1, "total_discount": "0.00", // Optional: Discount given for this item "sku": "", // Optional: SKU of the product "vendor": "Brand 123" // Optional: Vendor of the product } ], "note_attributes": [ // with this attribute we mark the items that got recommended by Stella // don't include a "__ask_stella_tracking" attribute if this purchase was not influenced by Stella { "name": "__ask_stella_tracking", "value": "[{\"id\":\"40814619394113\",\"analysis_id\":\"1234ASDF\",\"funnel\":\"funnelDomain\"}]" // JSON array with the variant ids of the recommended products encoded as string (also forward the analysis_id and funnel from the local storage) } ], "total_discounts": "0.00", "total_line_items_price": "24.00", "total_shipping_price": "3.99", "total_price": "28.99", "total_tax": "0.00", "client_details": { // Optional: Information about the browser of the user "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" } }
In the header X-Shop-Domain
you need to provide the domain of the shop to which the purchase belongs (e.g. example.com
).
Tracking of analysis sources
To analyse from where users came to start an analysis, we store the source
parameter of the query string of the iframe's URL with the analysis. We attach this parameter automatically for sources out of our own tools, e.g. the chat from StelleAssist will open the analysis with https://<your identifier>.askstella.ai/?source=chat
. If you want to track sources from your website, you can add the source
parameter to the URL of the iframe yourself with any parameter you like.
If you need even more control, we are also storing the full query string of the iframe's URL in the query_string
property of the analysis, which is available to you in the Webhook, the CRM sync and data exports.