Skip to content

Spektrix ecommerce tracking on Plausible Custom Event Sales #431

Description

@BluestormDigital

I'm looking to add in coding to track 'Sales' custom event to all purchases made on our Spektrix data layer. For example, we have this coding currently, which is bringing the number of times a sale has been made but cannot track the revenue through.

<script> window.plausible("Sales", {revenue: {currency: "GBP", value: 1.00}}); </script>

But we do not want to apply individual coding for each show as we are promoting over 50 shows. Is there a way to use the Spektrix data layer to pull through revenue data and all custom properties (of which we want to track item_variant, item_category, item_category2, item_category3, shipping, items, value, transaction_id, item_id, coupon, discount, quantity, price, item_name) from the order confirmation page using the custom Specktrix data layer and their variables - perhaps into something like this:

<script> window.plausible("Sales", {revenue: {currency: "GBP", amount: {value} }}); {props: {item_variant: {item_variant}, item_category: {item_category}, item_category2: {item_category2}, item_category3: {item_category2}, shipping: {shipping}, items: {items}, value: (value}, transaction_id: {transaction_id}, item_id: {item_id}, coupon: {coupon}, discount: {discount}, quantity: {quantity}, price: {price}, item_name: {item_name} </script>

To also attach the custom properties to the snippet, do I use the same variables set up too?

I feel like there needs to be another element to the coding e.g. datalayerpush etc. Any help would be greatly appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions