Tracking identifiers
Fixed names on the store buttons and one GA4 event schema, so GTM triggers and pixel rules work in every template.
The steps in this article are done in your store dashboard.Sign in to follow them
Every important button in your store carries the same names in every template, old and new. Switching template does not change them, so your Google Tag Manager triggers and pixel rules keep working as they are.
Attributes on the buttons
| Attribute | What it holds |
|---|---|
data-naq-action |
The kind of action (next table) |
data-naq-product-id |
The product number |
data-naq-variant-id |
The option (size or colour) number, when there is one |
data-naq-sku |
The product SKU |
data-naq-name |
The product name |
data-naq-category |
The product category |
data-naq-price |
The price in halalas, a whole number (14500 means 145.00 riyals) |
data-naq-currency |
The currency: |
data-naq-list |
The list the product appeared in: home, shop, search, category, wishlist, compare or product |
Actions and their events
data-naq-action |
dataLayer event |
|---|---|
add-to-cart |
add_to_cart |
buy-now |
add_to_cart |
wishlist-add / wishlist-remove |
add_to_wishlist / remove_from_wishlist |
compare-add / compare-remove |
add_to_compare / remove_from_compare |
stock-alert |
stock_alert |
coupon-apply / coupon-remove |
coupon_apply / coupon_remove |
checkout-start |
begin_checkout |
checkout-step |
checkout_step |
pay |
add_payment_info |
search |
search |
filter |
filter |
quick-view |
select_item (the «Choose options» button) |
share |
share |
whatsapp |
whatsapp_click |
cart-update / cart-remove |
cart_update / remove_from_cart |
The store also sends these on its own: page_view, view_item on a product page, view_item_list on the home, shop and compare pages, view_cart in the cart, begin_checkout on the checkout page, and purchase after the order.
The checkout page is Naqllah’s own page and looks the same in every store. The only tracking tool it loads is Google Analytics 4, which gets begin_checkout. Google Tag Manager and the Meta, TikTok, Snap and X pixels do not load there, so GTM tags tied to that page’s events do not fire. purchase reaches all of them from the order confirmation page.
Fixed ids
- The add button on a product page:
#naq-add-to-cart - The checkout form:
#naq-checkout-form - The place-order button:
#naq-pay - The search box:
#naq-search
The event in the dataLayer
Every event uses the GA4 ecommerce names: event, and ecommerce with currency, value and items. Each item in items has item_id, item_name, item_variant, price, quantity, item_category and item_list_name. An order also has transaction_id, coupon, shipping and tax. The pixels the store loads (Meta, TikTok, Snap, X and GA4) read from this same source.
Google Tag Manager examples
- Any add to cart, from anywhere: a «Custom event» trigger named
add_to_cart. - Only the compare button: a «Click — All elements» trigger where Click Element matches the CSS selector
[data-naq-action="compare-add"]. - The order value: a «Data layer variable» named
ecommerce.value. - The product that was pressed: a «DOM element» or click-attribute variable reading
data-naq-product-id.
Content Security Policy (CSP) limits
- Custom HTML tags in GTM work: the store gives GTM its security nonce, and GTM passes it to the scripts it adds.
- Custom JavaScript variables in GTM do not work in your store, because they need
unsafe-eval, which we will not open. Use GTM custom templates or the data-layer variables above instead. - Code in attributes such as
onclick=inside a custom HTML tag does not run. Put the code inside a<script>. - A provider that the tracking settings do not support is not loaded.
Common mistakes
- No event arrives: check that the shopper accepted marketing cookies; without consent no provider loads and no server event is sent.
- You relied on the button text or a template class: those change between templates. Use
data-naq-actionand the fixed ids only.