Data Action Listeners is a feature of SlideRule Analytics' GA4 integration that allows Shopify dvelopers and designers to easily track user interactions with HTML elements directly from code using data attributes.
data-action="view" enter the user's browser window.
The following attributes are tracked by default for both click and view events:
and all aria elements
Any data-attribute will also be tracked. For instance
will be tracked as
my_label = "my button"
You can customize the event name in two ways:
data-object="style" would result in an event name of
data-event-name="style selection" would result in an event name of
Note in both cases you still need the data-action="click" attribute.
Per Google Analytics 4 naming conventions all property names are snake cased.
All property values values are lower cased to avoid unintentionally duplicated values.
Make sure you observe GA4 collection limits.
Make sure you do not send personally identifiable information to GA4.