NAS Analytics Event Framework - UAT

GTM reads data-nas-ga-* attributes - no dataLayer pushes used for tracking events

Phase 1 UAT

Page Context

CMS puts context as data attributes on the <html> element - GTM reads them via DOM variables
DOM attributes
πŸ“‹
No dataLayer push needed. Instead of pushing page context into the dataLayer, the CMS outputs data attributes directly on the <html> element. GTM reads these using DOM element variables whenever any event fires, so every event automatically picks up the correct section, page type, and content age - with no JavaScript required from the site.
<!-- CMS outputs these on the <html> element for every page --> <html data-nas-ga-section="advice_guidance" data-nas-ga-page-type="article" data-nas-ga-content-age="current">

Change these values to simulate a different page type. GTM reads from the <html> element on every event, so all events below will reflect whatever is set here.

data-nas-ga-section
data-nas-ga-page-type
data-nas-ga-content-age

Current <html> attributes:

CTA Block

editor sets data-nas-ga-success in the CMS - GTM traverses to the element and reads it on click
editor configurable
🏷️
This is the core of the framework. GTM has a click trigger that fires on any element carrying data-nas-ga-success. It traverses the DOM to find that attribute, reads the value as success_type, and reads data-nas-ga-component as web_component. Editors set these in the CMS when they add a component - no developer needed per page.

The same CTA button template serves four different success types depending on what the editor sets.
<!-- Editor sets this in the CMS. GTM reads it on click. --> <a href="/services/..." data-nas-ga-success="navigation" data-nas-ga-component="cta_block"> Find a service </a>
Advice page - signpost to service

Find local support

Search our directory of autism-friendly services near you.

data-nas-ga-success="navigation"
data-nas-ga-component="cta_block"
Find a service
Resources page - download

Download our guide

A practical guide to understanding an autism diagnosis.

data-nas-ga-success="download"
data-nas-ga-component="cta_block"
πŸ“„ Download PDF
Appeal page - donation

Support our work

Your donation helps us reach more autistic people and families.

data-nas-ga-success="conversion"
data-nas-ga-component="cta_block"
Donate now
Helpline page - contact

Contact our helpline

Our specialist team can answer your questions about autism.

data-nas-ga-success="contact"
data-nas-ga-component="cta_block"
Get in touch

⚠️
No attribute = no event. If data-nas-ga-success is missing, GTM finds nothing and nothing fires. Coverage grows as editors configure components, but the data is never wrong.
Button with no data-nas-ga-success (nothing fires)

Resource Block

same attribute approach - data-nas-ga-component value separates these from CTA block events in GA4
download
πŸ“
Same mechanism, different component value. Every resource card has data-nas-ga-success="download" baked into the widget template - this is a single-purpose widget, so there's no need for editors to set it. The data-nas-ga-component="resource_block" value is what lets you split resource downloads from CTA block clicks in reporting.
<a href="/resources/guide.pdf" data-nas-ga-success="download" data-nas-ga-component="resource_block"> Autism diagnosis guide </a>

Donation Widget

baked-in - data-nas-ga-success fixed in the widget template, GTM reads it on the completion button click
conversion
πŸ’³
Single-purpose, baked in. This widget only ever fires conversion. The completion button has data-nas-ga-success="conversion" and data-nas-ga-component="donation_widget" fixed in the template - no editor config needed. GTM reads these on click, exactly the same as any other element.
βœ…

Donation complete

GTM read data-nas-ga-success="conversion" from the button and fired the event



Email Subscribe Block

baked-in - data-nas-ga-success fixed on the submit button in the widget template
connection
πŸ“§
Single-purpose, baked in. The submit button has data-nas-ga-success="connection" fixed in the template. GTM fires on click if the form is valid. If validation fails, the error element appears in the DOM with data-nas-ga-error="form_validation" - GTM reads that and fires a site_error event.
<button type="submit" data-nas-ga-success="connection" data-nas-ga-component="email_subscribe_block"> Subscribe </button>
Please enter a valid email address - error_detail: form_validation fired
βœ“ Subscribed - GTM read data-nas-ga-success="connection" and fired the event

Ask Ash

baked-in - tool_use on successful response, api_timeout error on failure
tool_use
πŸ€–
Single-purpose, baked in. The send button has data-nas-ga-success="tool_use" fixed in the template. If the API call fails, the error element gets data-nas-ga-error="api_timeout" and GTM reads that instead. Use the ⚠ button to simulate the failure path.
Hi, I'm Ash. Ask me anything about autism.
The ⚠ Error button simulates an API failure. GTM reads data-nas-ga-error from the element and fires site_error instead of a success.

Search Results

result_count read from a data attribute on the results container, navigation success on click-through
navigation
πŸ”
Two events, no pushes. When results render, the container element gets data-nas-ga-result-count set to the number of results. GTM reads that value on the search submit trigger. When a user clicks a result, GTM reads data-nas-ga-success="navigation" from the result element. Zero results fire with data-nas-ga-result-count="0".

Try searching: autism, diagnosis, support - or anything else for zero results.
<!-- Search results container - count set by the page after results load --> <div id="results" data-nas-ga-result-count="3" data-nas-ga-component="search_results">...</div> <!-- Each result item --> <a data-nas-ga-success="navigation" data-nas-ga-component="search_results">...</a>

Directory Listing

navigation success fires when a listing is clicked - baked into the listing template
navigation
πŸ—ΊοΈ
Baked in. Every directory listing always represents a navigation success - it's baked into the listing template. GTM reads data-nas-ga-success="navigation" and data-nas-ga-component="directory_listing" on click.
Ambitious About Autism
London Β· Education and support
β†’
Autism Together
Wirral Β· Residential and day services
β†’
Autism Wessex
Bournemouth Β· Community support
β†’

Deep Read - Article

consumption - scroll depth and time on page both required - reading time from data-nas-ga-reading-time on the article element
consumption
πŸ“–
No push needed for reading time either. The CMS puts the calculated reading time (words / 200) directly onto the article element as data-nas-ga-reading-time. GTM reads this value and uses it as the threshold for its timer trigger. Both the scroll depth trigger and the timer trigger must fire before the success event goes. This article uses 15 seconds for UAT.
<!-- CMS calculates reading time at publish and outputs it as an attribute --> <article data-nas-ga-success="consumption" data-nas-ga-component="article_body" data-nas-ga-reading-time="180"> ...article content... </article>

Understanding autism: an introduction

Autism is a lifelong developmental condition that affects how people perceive and interact with the world. It is a spectrum condition, which means that while all autistic people share certain characteristics, the condition affects each person differently and to varying degrees.

Autistic people may find some things more difficult than non-autistic people, but there are also many things autistic people find easier or experience differently. Autism is not a disease - it cannot be caught, and there is no cure. Many autistic people and their families see autism as a fundamental part of who they are, not something to be fixed.

The estimated number of autistic people in the UK is around 700,000, which means that with their families, autism touches the lives of 2.8 million people every day. Yet autistic people and their families often struggle to get the support they need, when they need it.

Research continues to improve our understanding of autism. The causes are complex, involving a combination of genetic and environmental factors. No single gene or cause has been identified.

Early diagnosis and appropriate support can make an enormous difference. Understanding that a child is autistic can help parents and teachers support them more effectively, and can help the autistic person themselves understand why they experience the world the way they do.

↓ Scroll to the bottom of this box to meet the scroll condition

Scroll depth
0%
Time on page (reading time from data-nas-ga-reading-time="15")
0s / 15s
Waiting for both conditions to be met...

Error / Friction Events

GTM reads data-nas-ga-error from validation error elements when they appear in the DOM
error_detail
⚠️
Errors via data attributes too. When a validation error occurs, the component shows an error element that carries data-nas-ga-error="[type]" and data-nas-ga-component="[widget]". GTM has an element visibility trigger watching for these elements - when one becomes visible, GTM reads the attribute values and fires a site_error event. All friction across the site flows through one consistent event with a controlled vocabulary.
<!-- Error element - hidden by default, shown when validation fails --> <p class="error-message" data-nas-ga-error="invalid_postcode" data-nas-ga-component="service_finder"> Please enter a valid UK postcode </p>
Enter a valid UK postcode - error_detail: invalid_postcode fired
File exceeds 10MB limit - error_detail: file_limit fired