Matomo, formerly Piwik, is an open source web analytics platform. It can be used to derive valuable insights into your website’s visitors and marketing campaigns so as to optimize your strategy and online experience for your visitors.
RudderStack supports Matomo as a destination to which you can seamlessly send your event data.
In the web device mode integration, that is, using JavaScript SDK as a source, RudderStack loads the Matomo native SDK from thehttps://cdn.matomo.cloud/ domain.
Based on your website’s content security policy, you might need to allowlist this domain to load the Matomo SDK successfully.
Get started
Once you have confirmed that the source platform supports sending events to Matomo, follow these steps:
From your RudderStack dashboard, add a source. Then, from the list of destinations, select Matomo.
Assign a name to the destination and click Continue.
Connection settings
To successfully setup Matomo as a destination, you will need to configure the following settings:
Matomo Version: Choose the Matomo version from the dropdown:
Premise Version: Choose this option if you have an on-premise Matomo setup.
Premise URL: Enter the SDK’s CDN URL in this field.
Cloud Version: Choose this option if you are using Matomo Cloud.
Server URL: Enter your server URL mentioned under the JavaScript Tracking Code section in Matomo dashboard.
Site Id: Enter your site Id mentioned under the JavaScript Tracking Code section in Matomo dashboard.
Refer to the FAQ section below for more information on finding the Server URL and Site Id.
Event settings
Mapping to trigger the Matomo Goal ID for the respective Events: Enter the Event Name and the Goal Id to be triggered when that event is called.
You can specify multiple Goal Id’s for one Event Name and vice versa.
Mapping to trigger the Matomo standard events for the respective Events: Enter the event name and pick the standard event from the dropdown to be triggered when that event is called.
You can specify multiple Standard Events for one Event Name and vice versa.
Track All Content Impressions: Enable this setting to scan the entire DOM for all content blocks and track all impressions, once the DOM ready event has been triggered.
Track Visible Content Impressions: Enable this setting to scan the entire DOM for all content blocks as soon as the page is loaded. It tracks an impression only if a content block is actually visible. If enabled, also enter the following:
Check on Scroll: Checks whether the previously hidden content blocks became visible meanwhile after a scroll and if yes, then tracks the impression. It is enabled by default.
Time interval in ms: Enter the time to rescan the entire DOM for new content impressions. By default, the rescan is done every 750ms. To disable it, pass the value as 0.
Log All Content Blocks On Page: Enable this setting to log all content blocks found within a page to the console. This is useful while debugging/testing the content tracking.
Enable Heart Beat Timer: Enable this setting to install a heart beat timer to send additional requests to Matomo to measure the time spent in the visit. These requests will be sent only when the user’s tab is active and in focus and will not track additional actions or pageviews. If enabled, also enter the following:
Active Time in seconds: Enter the time interval after which a ping request should be sent. The default value is 15 seconds, meaning that if a page is viewed for at least 15 seconds, only then a ping request will be sent.
Enable Link Tracking: Enable this setting to install link tracking on all applicable link elements.
Disable Performance Tracking: Enable this setting to disable the page performance tracking.
Enable Cross Domain Linking: Enable this setting to enable cross domain linking. Refer to the Matomo document for more information.
Set Cross Domain Linking Timeout: Enable this setting to set the cross domain linking timeout (in seconds). If enabled, also enter the following:
Timeout: Enter the timeout interval. By default, the two visits across domains are linked together when the link is clicked and the page is loaded within a 180 seconds timeout window.
Get Cross Domain Linking Url Parameter: Enable this setting to get the query parameter to append to links to handle cross domain linking. Refer to the Matomo document for more information.
Disable Browser Feature Detection: Enable this setting to disable the browser feature detection. Refer to the Matomo document for more information.
Web device mode settings
Use device mode to send events: As this is a device mode-only destination, this setting is enabled by default and cannot be disabled.
Identify
RudderStack sets the ID value in the cache to the userId or anonymousId present in the identify call.
A sample identify call is shown below:
rudderanalytics.identify("1hKOmRA4GRlm");
The following table lists the RudderStack and Matomo property to set the userId in the identify call:
The following table lists the property mappings between RudderStack and Matomo for trackEvent:
RudderStack property
Matomo property
Presence
properties.category
category
Required
properties.action
action
Required
event
name
Optional
properties.value
value
Optional
Standard events
For RudderStack to send an event as a standard Matomo event, you need to specify the event mapping under the Mapping to trigger the Matomo standard events for the respective Events setting in the RudderStack dashboard. For more information, refer to the Event settings section above.
RudderStack supports the following Matomo standard events:
RudderStack first verifies if an event is mapped to a standard Matomo event. If so, it sends the event to Matomo with some specific properties, as listed in the following sections.
These properties should be present in the events for RudderStack to successfully send them to Matomo.
Ping
Use this event to send a ping request.
The ping requests do not track new actions. Matomo ignores these requests if they’re sent after a standard visit length.
Track Content Impressions
Use this event to track a content impression using the specified values.
RudderStack maps the following event properties to the Matomo standard event properties:
RudderStack property
Matomo property
Description
properties.contentName
contentName
Represents a content block visible in the reports. One name can represent different content pieces.
properties.contentPiece
contentPiece
Actual displayed content, for example, path to a video, image, etc.
properties.contentTarget
contentTarget
URL of the landing page where the user was directed to after interacting with the block.
Track Content Impressions Within Node
Use this event to scan a given DOM node and its associated children for content blocks and track impressions for them, if not done already.
RudderStack maps the following event properties to the Matomo standard event properties:
RudderStack property
Matomo property
properties.domId/ properties.dom_id
domId
Track Content Interaction
Use this event to track a content interaction with the specified values.
RudderStack maps the following event properties to the Matomo standard event properties:
RudderStack property
Matomo property
properties.contentInteraction
contentInteraction
properties.contentName
contentName
properties.contentPiece
contentPiece
properties.contentTarget
contentTarget
Track Content Interaction Node
Use this event to track the interaction with a given DOM node or a content block.
RudderStack maps the following event properties to the Matomo standard event properties:
RudderStack property
Matomo property
properties.domId/ properties.dom_id
domId
properties.contentInteraction
contentInteraction
Track Link
Use this event to log a click from your code.
RudderStack maps the following event properties to the Matomo standard event properties:
RudderStack property
Matomo property
Description
properties.url/ message.context.page.url
url
The full URL to be tracked as a click.
properties.linkType
linkType
Defines the link type. Can either be link for an outlink or download for the download link type.
Track Site Search
Use this event to track an internal site search for a given keyword with an optional category and specifying the optional search results count in the page.
RudderStack maps the following event properties to the Matomo standard event properties:
grandTotal is not a default property in the Order Completed event and needs to be provided by the user. If not provided, RudderStack calculates it manually by iterating through the products array, as shown below:
Similarly, subtotal is calculated as the total value of all sales, excluding shipping and tax.
Update Cart
Although Update Cart is not a standard RudderStack Ecommerce Event, you can still send this event to update your cart and view the items that are currently present in it.
RudderStack also maps the Update Cart event name to trackEcommerceCartUpdate. The following event properties are mapped to the Matomo properties:
RudderStack property
Matomo property
Presence
properties.total/properties.revenue
grandTotal
Required
Page
The page call lets you record your website’s page views with any additional relevant information about the viewed page.
A sample page call is shown below:
rudderanalytics.page("home","games");
RudderStack does not consider any parameters inside the page call and simply calls the trackPageView event for each page call.
Custom dimensions
Custom dimensions can be used to track any information related to any action or visitors.
You can send the custom dimensions to Matomo only through the track calls.
RudderStack provides customDimension field which can be used inside the integrations object, as shown below:
Refer to the Matomo help guide to know about the data limitations for custom dimensions in Matomo.
RudderStack does not support sending custom variables to Matomo. Matomo recommends using custom dimensions instead. For more information, refer to this Matomo page.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.