Closed eddierubeiz closed 3 months ago
Hm, before we were just adding some data-* attributes on every hyperlink, and had some code that caught click events with those data events, and then reported them to ga.
I was anticipating doing the same thing, but expanding our code to look for form submits not just hyperlinks?
I'm not totally following what's going on here. Maybe we should talk about it?
Closing in favor of #2715 . Cleaner, more maintainable.
Ref #2606.
custom_google_analytics_4_events.js
so that it exports a function we can call from the search code. Seemed like the DRYest thing to do, although I'm open to other ideas.event_value
parameter, which we don't use anywhere else in the digital collections, to report the query string to GA. (This is a bit of an experiment.)event_value
somewhere else later, I tweaked thecustom_google_analytics_4_events.js
to also look for adata-analytics-value
on the decorated link, and send it to GA along with the other metadata. Does not affect any existing reporting, asgetAttribute
will just returnnull
in existing code.