Matomo: importing historical data
This page explains how to reimport into Eulerian a history of aggregated data from Matomo Analytics, for certain types of report. The rules common to all reimports are in General information.
Setting up the reimport
To set up the Matomo Analytics data reimport, follow the steps below.
Step 1 · Enable the Matomo Analytics API
The API must be enabled on your Matomo Analytics account.
Step 2 · Create API access
Create API access from your Matomo Analytics interface.
Step 3 · Get the connection details
Get the following information:
- the
token_auth; - the domain where your data is hosted, usually in the format
mon-instance.matomo.cloud.
Step 4 · Get the site to synchronise
Get the idSite you want to synchronise.
Step 5 · Enable the connector in Eulerian
Once API access is enabled, log in to the Eulerian interface and enable the Matomo Analytics Import data reimport connector.
Data synchronised
Note
The
page viewsmetric (hit/nb_hits/nb_pageviews) is not available in the API method provided by the Matomo API for search engines, referring sites, free social networks, paid acquisition sources and the geographic level.
Overall site-level data
The following metrics are imported:
- visits (
nb_visits); - page views (
nb_pageviews); - daily unique visitors (
nb_uniq_visitors); - time spent (
sum_visit_length); - sales (
nb_conversions), if the site is of typeecommerce; - revenue (
revenue), if the site is of typeecommerce.
API method: API.get
Page-level data
The following metrics are imported:
- visits (
nb_visits); - page views (
nb_hits); - entry visits (
entry_nb_visits); - single-page visits (
entry_bounce_count); - exit visits (
exit_nb_visits); - time spent (
sum_time_spent).
API method: Actions.getPageUrls
The following additional dimensions are imported automatically and attached to the imported page:
- the page URL, if available, is retrieved and attached to the page concerned.
Search engine data
The following metrics are imported:
- visits (
nb_visits); - daily unique visitors (
nb_uniq_visitors); - time spent (
sum_visit_length); - sales (
nb_conversions), if the site is of typeecommerce; - revenue (
revenue), if the site is of typeecommerce.
API method: Referrers.getSearchEngines
Referring site data (referrers)
The following metrics are imported:
- visits (
nb_visits); - daily unique visitors (
nb_uniq_visitors); - time spent (
sum_visit_length); - sales (
nb_conversions), if the site is of typeecommerce; - revenue (
revenue), if the site is of typeecommerce.
API method: Referrers.getWebsites
Free social network data
The following metrics are imported:
- visits (
nb_visits); - daily unique visitors (
nb_uniq_visitors); - time spent (
sum_visit_length); - sales (
nb_conversions), if the site is of typeecommerce; - revenue (
revenue), if the site is of typeecommerce.
For each existing network, an entry is created and attached to the Free Social channel:
- the name of the media outlet used is the value supplied in the
labelproperty, for exampleYoutube. This value is converted to lower case to avoid creating duplicates; - the campaign name is the
labelvalue with the suffix-social, for exampleYoutubebecomesyoutube - social.
API method: Referrers.getSocials
Paid acquisition source data
The following metrics are imported:
- visits (
nb_visits); - daily unique visitors (
nb_uniq_visitors); - time spent (
sum_visit_length); - sales (
nb_conversions), if the site is of typeecommerce; - revenue (
revenue), if the site is of typeecommerce.
API method: MarketingCampaignsReporting.getSourceMedium
Note
The Matomo API provides little neatly organised detail on sources, media and campaigns. The categorisation is therefore far from perfect.
The following processing is applied to categorise the traffic from the data returned by the Matomo API:
- the
sourceandmediumare derived from thelabel, for examplegoogle - cpcgivessource=googleandmedium=cpc; - the
sourceandmediumare converted to lower case and non-alphanumeric characters are removed; - the
mediumis used to decide which channel the campaign is attached to; - the
sourceis used as the media outlet name; - the
labelis used as the campaign name, with the suffix- campaign, for example thelabelgoogle - cpcgives the campaign namegoogle - cpc - campaign.
Channel mapping table based on the medium:
emailing,email,courriel,newsletterare attached to the Mailing channel;display,epub,banner,retargetingare attached to the Display channel;cpcis attached to the SEA / Sponsored links channel;socialis attached to the Social channel;affiliation,affiliateare attached to the Affiliation channel.
If no clause matches, the Generic channel is used.
Overall geographic data
Data is retrieved at the level of:
- country.
The following metrics are imported:
- visits (
nb_visits); - daily unique visitors (
nb_uniq_visitors); - time spent (
sum_visit_length); - sales (
nb_conversions), if the site is of typeecommerce; - revenue (
revenue), if the site is of typeecommerce.
API method: UserCountry.getCountry