Spektrix ecommerce tracking on Plausible Custom Event Sales

Open
#431 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript

Research direction

No repository file or test is identified. Start by reviewing the existing Plausible custom-event guidance and the Spektrix order-confirmation data layer; done means the documentation explains how to map purchase revenue and the listed properties into one Sales event without per-show code.

Written by the indexing model from the issue text.

Description

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.

Dominant language
CSS
Stars
429
Forks
275
Avg merge
3m
Merged PRs (30d)
16

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plausible/docs

All issues in plausible/docs

Similar issues

More Data Visualization issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.