Context
There are several ways to integrate the Matomo Javascript tracking code into WordPress:
- With Google Tag Manager
- With Matomo Tag Manager
- Directly in the theme files
- Via a WordPress hook
- With your cookie banner manager
Installing the Matomo tracking code with Elementor Pro
Here’s how to do it with Elementor Pro and the Custom Code feature.

In the Dashboard, go to the section for managing custom codes to be injected.

Then click on the Add New button.

- Enter the title of the code, which you will use to identify it from the list of custom codes
- Choose <head> as location
- Place the Javascript code for integrating Matomo
- Indicate the priority to manage the insertion order of the current code in relation to the other custom codes.
- Publish the custom code