Documentation
Back
  • Getting started with Quadrano Local
  • Creating a Specification
  • Installing the snippet in GTM
  • One Specification per site
  • Reading the Console output
  • Troubleshooting

Creating a Specification

Create the Demo Shop Specification in Quadrano Local from the Event Catalogue, in GA4's shape, and build an Event Definition by hand.

Creating a Specification

An Event Definition is the rules for one event your site pushes: which Attributes it has and what each must satisfy. An Attribute is one key in a pushed event, with rules of its own such as a type or a list of allowed values.

This doc builds the demo shop's Specification. The demo shop, demo.quadrano.com, pushes add_to_cart and purchase.

What you'll need

  • A browser, open on Quadrano Local.

What you'll have

  • A Specification named Demo Shop with two Event Definitions, exported as a Quadrano Local file.

Steps

  1. Open Quadrano Local. If the browser already has a Specification, choose Start a new Specification. You should see an empty Specification.

  2. Name the Specification. In the Specification name box, type Demo Shop. You should see the name update.

  3. Add add_to_cart from the Event Catalogue. Choose Add from Event Catalogue, then choose Add beside Add to cart (GA4). You should see a new Event Definition marked From Event Catalogue, with add_to_cart in the Event name in the data layer box.

  4. Look at its Attributes. Like GA4's own ecommerce events, every Attribute sits inside one Group of Attributes named ecommerce: currency (one of GBP, EUR or USD), value (a number) and items, a List of items where each item has an item_id and, optionally, an item_name, a price and a quantity. This already matches the demo shop's push, so there is nothing to change.

  5. Add purchase from the Event Catalogue. Choose Add from Event Catalogue, then choose Add beside Purchase (GA4). You should see a second Event Definition, with the same ecommerce group plus a transaction_id.

  6. Tighten the order id. In purchase, inside the ecommerce group, find the Attribute transaction_id. Replace its Pattern with ^T-[0-9]{6}$. The demo shop's order ids look like T-104233, so any other order id now fails.

  7. Test an event. Choose Test an event, paste the push below, then choose Test. You should see Pass. Change T-104233 to 12345 and choose Test again: you should see Fail, naming ecommerce.transaction_id.

    dataLayer.push({ "event": "purchase", "ecommerce": { "transaction_id": "T-104233", "currency": "GBP", "value": 12.99, "items": [{ "item_id": "SKU-1001", "item_name": "Stoneware Mug", "price": 12.99, "quantity": 1 }] } })
    
  8. Check the readiness message. If the page says Add an Event Definition first., the Specification is empty: add an Event Definition first.

  9. Keep a copy. Choose Export file. You should see a Quadrano Local file download.

Building an Event Definition by hand

For an event the Event Catalogue doesn't have, build the Event Definition yourself. As an example, this builds the same add_to_cart by hand.

  1. Add an Event Definition. Choose Add Event Definition. In the Event name in the data layer box, type add_to_cart. In the Name box, type Add to cart. A Name tells Event Definitions apart.

  2. Add the ecommerce group. Choose Add Attribute. Set its name to ecommerce, choose the Type Group of Attributes, then tick Required.

  3. Add currency to the group. Inside the group, choose Add an Attribute to this group. Set its name to currency, choose the Type Text and tick Required. Choose Allowed values, then type GBP and press Enter, then EUR, then USD.

  4. Add value to the group. Choose Add an Attribute to this group. Set its name to value, choose the Type Number and tick Required.

  5. Add the items list. Choose Add an Attribute to this group. Set its name to items, choose the Type List of items and tick Required. Inside the list, choose Add an Attribute to each item for each of item_id (Text, Required), item_name (Text), price (Number) and quantity (Whole number).

Next

Continue to Installing the snippet in GTM.