Pixel V1 Tracking guide - Stylitics/guide GitHub Wiki

Stylitics can deliver reporting on key metrics with a few simple steps.

Tracking script

On your order confirmation page, place a script tag:

<script src="//widget.stylitics.com/pixel.js?param1=val&param2=val2..."></script>

Instead of the placeholder URL params above, you'll want to construct the URL's query string based on the following params & the values relevant to the confirmed purchase:

  • data-client - string - the username given to you by stylitics. (Same as the data-username param in the widget)
  • data-order-total - decimal - the total cost of the customer's order (ideally without shipping, tax, or individual promo-code discounts)
  • data-ids - comma separated string - the ids for the products in the order (these should correspond to the same type of identifier you use for widget or API requests - typically a colorway-level ID)
  • data-order-id - optional string - a unique ID for this order. Useful for reconciling Stylitics metrics with client metrics per order
  • data-test - any - include this param with any non-null value to indicate that this order should not be tracked (intended for use on staging / QA environments)

For widget users

No further steps required.

For API users

If you are implementing a web front-end for your outfit content, we ask that upon load you set a cookie called "styliticsWidgetSession" with the value of session_id of the first outfit in the API response from /api/outfits. This cookie should live for 96 hours (or the value of your choice, but please let us know) and only be set/overwritten if it is not present. This lets the tracking script on the order confirmation page distinguish between users who have seen outfits and those who haven't.

⚠️ **GitHub.com Fallback** ⚠️