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 Shopwith two Event Definitions, exported as a Quadrano Local file.
Steps
Open Quadrano Local. If the browser already has a Specification, choose Start a new Specification. You should see an empty Specification.
Name the Specification. In the Specification name box, type
Demo Shop. You should see the name update.Add
add_to_cartfrom the Event Catalogue. Choose Add from Event Catalogue, then choose Add besideAdd to cart (GA4). You should see a new Event Definition marked From Event Catalogue, withadd_to_cartin the Event name in the data layer box.Look at its Attributes. Like GA4's own ecommerce events, every Attribute sits inside one Group of Attributes named
ecommerce:currency(one ofGBP,EURorUSD),value(a number) anditems, a List of items where each item has anitem_idand, optionally, anitem_name, apriceand aquantity. This already matches the demo shop's push, so there is nothing to change.Add
purchasefrom the Event Catalogue. Choose Add from Event Catalogue, then choose Add besidePurchase (GA4). You should see a second Event Definition, with the sameecommercegroup plus atransaction_id.Tighten the order id. In
purchase, inside theecommercegroup, find the Attributetransaction_id. Replace its Pattern with^T-[0-9]{6}$. The demo shop's order ids look likeT-104233, so any other order id now fails.Test an event. Choose Test an event, paste the push below, then choose Test. You should see Pass. Change
T-104233to12345and choose Test again: you should see Fail, namingecommerce.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 }] } })Check the readiness message. If the page says Add an Event Definition first., the Specification is empty: add an Event Definition first.
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.
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, typeAdd to cart. A Name tells Event Definitions apart.Add the
ecommercegroup. Choose Add Attribute. Set its name toecommerce, choose the Type Group of Attributes, then tick Required.Add
currencyto the group. Inside the group, choose Add an Attribute to this group. Set its name tocurrency, choose the Type Text and tick Required. Choose Allowed values, then typeGBPand press Enter, thenEUR, thenUSD.Add
valueto the group. Choose Add an Attribute to this group. Set its name tovalue, choose the Type Number and tick Required.Add the
itemslist. Choose Add an Attribute to this group. Set its name toitems, choose the Type List of items and tick Required. Inside the list, choose Add an Attribute to each item for each ofitem_id(Text, Required),item_name(Text),price(Number) andquantity(Whole number).
Next
Continue to Installing the snippet in GTM.