Oops… there was a problem during the request. Maybe the server had a temporary issue, or maybe you requested a report with too much data. Please try again. If this error occurs repeatedly please contact your Matomo administrator for assistance.

Need more help? FAQCommunity HelpProfessional Help.

Tracking Code

Matomo offers you various ways to embed the tracking code for your website, mobile app, and even for any device or application.

You can track visitors to your website in many different ways. The recommended way to do it is through JavaScript. To use this method you must make sure every webpage of your website has some JavaScript code, which you can generate here.

Once you have the JavaScript tracking code for your website, copy and paste it to all the pages you want to track with Matomo. In most websites, blogs, CMS, etc. you can use a pre-made plugin to do the technical work for you. (See our list of plugins used to integrate Matomo.) If no plugin exists you can edit your website templates and add the JavaScript tracking code to the </head> tag which is often defined in a 'header.php', 'header.tpl' or similar template file.

If you don't want to use JavaScript to track visitors, generate an image tracking link below.

If you want to do more than track page views, please check out the Matomo Javascript Tracking documentation for the list of available functions. Using these functions you can track goals, custom variables, ecommerce orders, abandoned carts and more.

So if one visitor visits x. and y., they will be counted as a unique visitor. (learn more)
So if someone visits the 'About' page on blog. it will be recorded as 'blog / About'. This is the easiest way to get an overview of your traffic by sub-domain.
So clicks on links to Alias URLs (eg. ) will not be counted as "Outlink".


show hide

By default, the visitor ID that identifies a unique visitor is stored in the browser's first party cookies which can only be accessed by pages on the same domain. Enabling cross domain linking lets you track all the actions and pageviews of a specific visitor into the same visit even when they view pages on several domains. Whenever a user clicks on a link to one of your website's alias URLs, it will append a URL parameter pk_vid forwarding the Visitor ID.
Note: To use cross domain linking, you must specify more than one domain name (URLs) for your website.
So tracking requests will not be sent if visitors do not wish to be tracked.
Note: Server side DoNotTrack support has been enabled, so this option will have no effect.

JavaScript Tracking Code

Make sure this code is on every page of your website. We recommend pasting it immediately before the closing </head> tag.


When a visitor has disabled JavaScript, or when JavaScript cannot be used, you can use an image tracking link to track visitors. Generate the link below and copy-paste the generated HTML in the page. If you're using this as a fallback for JavaScript tracking, you can surround it in <noscript></noscript> tags.

For the whole list of options you can use with an image tracking link, see the Tracking API Documentation.

An alternative to tracking visitors through the browser (either via JavaScript or an image link) is to continuously import server logs. Learn more about Server Log File Analytics.

Not tracking a website? You can alternatively track a mobile app or any other type of application using one of the available SDKs.

The HTTP Tracking API allows you to track anything. This may be useful if you are using a programming language for which no SDK exists yet. It may also be useful when you want to track devices or application in a special way.

Available shortcuts