Commit d76cc3b
committed
Adds support for Matomo Tag Manager containers
** Why are these changes being introduced:
One of the instances of this application, GeoData, has an existing
integration with Matomo using their legacy approach that relies on a
site ID.
The USE UI project will be using a newer integration, which requires us
to support Matomo Tag Manager.
** Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/use-160
** How does this address that need:
This adds a second option for integration with Matomo, using just a
single ENV variable - for the container URL. We do this by extending the
conditional in the _head partial, allowing the application to support
_either_ a tag manager container _or_ the legacy approach, but not both.
Once GeoData gets converted over to using a tag manager container, we
will be able to drop that half of this conditional.
** Document any side effects to this change:
The legacy integration has a bit of bespoke javascript in order to let
turbo frames interactions be sent to Matomo. Thanks to whomever left the
URL to the github issue about this approach, which led me to
https://developer.matomo.org/guides/spa-tracking - which tells me that
we don't need to worry about this under a tag manager context. As a
result, I've left that code out of the new integration, and we'll
handle tracking all changes directly within the Matomo container.1 parent 20ad4d3 commit d76cc3b
2 files changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
| |||
0 commit comments