Does the React integration of Matomo completely replace the <script> tags for tracking and tags?

As the title says.
This is the first time I am using Matomo with a SPA. I am little bit confused about the documentation. The first point says that if there is an integration you should use that, but isn’t very explicit about whether this means that you should do none of the other things listed in the documentation.
After messing about with it I managed to get basic page and event tracking working by using useEffect on layout components that wrap all content.

But how do you use tags if using the React implementation? The tag manager is what creates the dataLayer right?

This is not clear… What do you mean?

The Tag manager manages… Tags! (in other words: events sent to your Matomo or any other Analytics platform) And all needed things for making tags working: triggers, any kind of variables (including the datalayer) used by tags and triggers…

If you look at the documentation for SPA tracking
it says " If available, consider using an existing integration for your framework"
But I am unclear if it means you should not do all the next steps.

The Tag manager manages… Tags! (in other words: events sent to your Matomo or any other Analytics platform) And all needed things for making tags working: triggers, any kind of variables (including the datalayer) used by tags and triggers…

Well then I guess my question is, can and should you use the tag manager with the React integration?

See:

Yes you can and yes you should :slight_smile:

1 Like

can tag slow downs a page speed?

Most of times: no.
But if you do slow JavaScript processes (eg in variables) or use thousand of triggers and/or tags, then probably yes…