# Matomo

<p><a href="https://matomo.org/" >Matomo</a>, formerly Piwik, is an open source web analytics platform. It can be used to derive valuable insights into your website&rsquo;s visitors and marketing campaigns so as to optimize your strategy and online experience for your visitors.</p>
<p>RudderStack supports Matomo as a destination to which you can seamlessly send your event data.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="connection-compatibility">Connection compatibility</h2>
  
  
  
  <div class="quick-info">
    <div>
      <div class="connection-modes-column-headers">
        <table>
          <tr class="connection-modes-column-headers">
            <th colspan="4">
            Destination Information
          </th>
        </tr>
          <tr class="destination-info-content">
            <td>
              <ul>
                <li>
                  <b>Status:</b> Generally Available 
                </li>
                <li>
                  <b>Supported sources:</b>  
                  
                      Web
                  
                </li>
                <li>
                  Refer to it as <b>Matomo</b> in the <a href="/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/filtering/#filtering-destinations">Integrations object</a>.
                </li>
              </ul>
            </td>
          </tr>
        </table>
      </div>
      <div class="table-content connection-modes-table">
        
          <table>
            <tr class="heading connection-modes-header">
              <th colspan="4">
              Connection Modes
              <a href=/docs/destinations/rudderstack-connection-modes>
                <i class="fa-regular fa-circle-info"></i>
              </a>
            </th>
          </tr>
            <tr class="connection-modes-column-headers">
              <th>Source</th>
              <th>Cloud mode</th>
              <th>Device mode</th>
              <th>Hybrid mode</th>
            </tr>
            
            <tr class="connection-modes-row">
              <td>
                Web
                
              </td>
              <td>
                 <img src=/docs/images/no-image.svg loading="lazy"
                    decoding="async" class="img__small" alt="not supported" />
              </td>
              <td>
                <img src=/docs/images/tick.svg loading="lazy" decoding="async" class="img__small" alt="supported" />
              </td>
              <td>
                 <img src=/docs/images/no-image.svg loading="lazy"
                    decoding="async" class="img__small" alt="not supported" />
              </td>
            </tr>
            
          </table>
         
      </div>
      <div class="table-content message-types-table">
          <table>
            <tr class="heading message-types-header">
              <th colspan="9">
              Supported Message Types
            </th>
          </tr>
          <tr class="message-types-column-headers">
            <th>Source</th>
            <th>Identify</th>
            <th>Page</th>
            <th>Track</th>
            <th>Screen</th>
            <th>Group</th>
            <th>Alias</th>
            <th>Record</th>
            <th>AudienceList</th>
          </tr>
          
          
          
            
              
              
          
          
          
            
              <tr class="heading message-mode-header">
                <th colspan="9">Device mode</th>
              </tr>
              
              <tr class="message-mode-row">
                <td>
                  Web
                  
                </td>
                <td>
                  <img src=/docs/images/tick.svg loading="lazy" decoding="async" class="img__small" alt="supported" />
                </td>
                <td>
                  <img src=/docs/images/tick.svg loading="lazy" decoding="async" class="img__small" alt="supported" />
                </td>
                <td>
                  <img src=/docs/images/tick.svg loading="lazy" decoding="async" class="img__small" alt="supported" />
                </td>
                <td>
                   <img src=/docs/images/no-image.svg loading="lazy"
                      decoding="async" class="img__small" alt="not supported" />
                </td>
                <td>
                   <img src=/docs/images/no-image.svg loading="lazy"
                      decoding="async" class="img__small" alt="not supported" />
                </td>
                <td>
                   <img src=/docs/images/no-image.svg loading="lazy"
                      decoding="async" class="img__small" alt="not supported" />
                </td>
                <td>
                   <img src=/docs/images/no-image.svg loading="lazy"
                      decoding="async" class="img__small" alt="not supported" />
                </td>
                <td>
                   <img src=/docs/images/no-image.svg loading="lazy"
                      decoding="async" class="img__small" alt="not supported" />
                </td>
              </tr>
              
            
          
            </table>
        </div>
    </div>
  </div>
  

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text"><p>In the web device mode integration, that is, using <a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/" >JavaScript SDK</a> as a source, RudderStack loads the Matomo native SDK from the<code>https://cdn.matomo.cloud/</code> domain.</p>
<p>Based on your website&rsquo;s content security policy, you might need to <a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk/#allowlist-destination-domain" >allowlist this domain</a> to load the Matomo SDK successfully.</p>
</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="get-started">Get started</h2><p>Once you have confirmed that the source platform supports sending events to Matomo, follow these steps:</p>
<ol>
<li>From your <a href="https://app.rudderstack.com/" >RudderStack dashboard</a>, add a source. Then, from the list of destinations, select <strong>Matomo</strong>.</li>
<li>Assign a name to the destination and click <strong>Continue</strong>.</li>
</ol>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="connection-settings">Connection settings</h2><p>To successfully setup Matomo as a destination, you will need to configure the following settings:</p>
<ul>
<li>
<p><strong>Matomo Version</strong>: Choose the Matomo version from the dropdown:</p>
<ul>
<li><strong>Premise Version</strong>: Choose this option if you have an on-premise Matomo setup.
<ul>
<li><strong>Premise URL</strong>: Enter the SDK&rsquo;s CDN URL in this field.</li>
</ul>
</li>
<li><strong>Cloud Version</strong>: Choose this option if you are using Matomo Cloud.
<ul>
<li><strong>Server URL</strong>: Enter your server URL mentioned under the <strong>JavaScript Tracking Code</strong> section in Matomo dashboard.</li>
</ul>
</li>
</ul>
</li>
<li>
<p><strong>Site Id</strong>: Enter your site Id mentioned under the <strong>JavaScript Tracking Code</strong> section in Matomo dashboard.</p>
</li>
</ul>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">Refer to the <a href="#faq" >FAQ</a> section below for more information on finding the Server URL and Site Id.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="event-settings">Event settings</h3><p>

<figure class="image--main "  >
    <a 
         href="/docs/images/event-stream-destinations/matomo-connection-settings-1.webp"
        
        >
        <img src="/docs/images/event-stream-destinations/matomo-connection-settings-1.webp" 
         alt="Matomo connection settings"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<figure class="image--main "  >
    <a 
         href="/docs/images/event-stream-destinations/matomo-connection-settings-2.webp"
        
        >
        <img src="/docs/images/event-stream-destinations/matomo-connection-settings-2.webp" 
         alt="Matomo connection settings"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<figure class="image--main "  >
    <a 
         href="/docs/images/event-stream-destinations/matomo-connection-settings-3.webp"
        
        >
        <img src="/docs/images/event-stream-destinations/matomo-connection-settings-3.webp" 
         alt="Matomo connection settings"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

</p>
<ul>
<li><strong>Mapping to trigger the Matomo Goal ID for the respective Events</strong>: Enter the <strong>Event Name</strong> and the <a href="https://developer.matomo.org/guides/tracking-javascript-guide#manually-trigger-goal-conversions" >Goal Id</a> to be triggered when that event is called.</li>
</ul>

<blockquote class="success">
  <div class="tip-quote">
    
    <div class="tip-text">
      You can specify multiple <strong>Goal Id&rsquo;s</strong> for one <strong>Event Name</strong> and vice versa.
    </div>
  </div>
</blockquote>
<ul>
<li><strong>Mapping to trigger the Matomo standard events for the respective Events</strong>: Enter the event name and pick the standard event from the dropdown to be triggered when that event is called.</li>
</ul>

<blockquote class="success">
  <div class="tip-quote">
    
    <div class="tip-text">
      You can specify multiple <strong>Standard Events</strong> for one <strong>Event Name</strong> and vice versa.
    </div>
  </div>
</blockquote>
<ul>
<li><strong>Track All Content Impressions</strong>: Enable this setting to scan the entire DOM for all content blocks and track all impressions, once the DOM ready event has been triggered.</li>
<li><strong>Track Visible Content Impressions</strong>: 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:
<ul>
<li><strong>Check on Scroll</strong>: 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.</li>
<li><strong>Time interval in ms</strong>: 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.</li>
</ul>
</li>
<li><strong>Log All Content Blocks On Page</strong>: Enable this setting to log all content blocks found within a page to the console. This is useful while debugging/testing the content tracking.</li>
<li><strong>Enable Heart Beat Timer</strong>: 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&rsquo;s tab is active and in focus and will not track additional actions or pageviews. If enabled, also enter the following:
<ul>
<li><strong>Active Time in seconds</strong>: 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.</li>
</ul>
</li>
<li><strong>Enable Link Tracking</strong>: Enable this setting to install link tracking on all applicable link elements.</li>
<li><strong>Disable Performance Tracking</strong>: Enable this setting to disable the page performance tracking.</li>
<li><strong>Enable Cross Domain Linking</strong>: Enable this setting to enable cross domain linking. Refer to the <a href="https://developer.matomo.org/api-reference/tracking-javascript#:~:text=enableCrossDomainLinking" >Matomo document</a> for more information.</li>
<li><strong>Set Cross Domain Linking Timeout</strong>: Enable this setting to set the cross domain linking timeout (in seconds). If enabled, also enter the following:
<ul>
<li><strong>Timeout</strong>: 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.</li>
</ul>
</li>
<li><strong>Get Cross Domain Linking Url Parameter</strong>: Enable this setting to get the query parameter to append to links to handle cross domain linking. Refer to the <a href="https://developer.matomo.org/api-reference/tracking-javascript#:~:text=getCrossDomainLinkingUrlParameter" >Matomo document</a> for more information.</li>
<li><strong>Disable Browser Feature Detection</strong>: Enable this setting to disable the browser feature detection. Refer to the <a href="https://developer.matomo.org/api-reference/tracking-javascript#:~:text=disableBrowserFeatureDetection" >Matomo document</a> for more information.</li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="web-device-mode-settings">Web device mode settings</h3>

<figure class="image--main "  >
    <a 
         href="/docs/images/event-stream-destinations/matomo-connection-settings-4.webp"
        
        >
        <img src="/docs/images/event-stream-destinations/matomo-connection-settings-4.webp" 
         alt="Matomo connection settings"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<ul>
<li><strong>Use device mode to send events</strong>: As this is a device mode-only destination, this setting is enabled by default and cannot be disabled.</li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="identify">Identify</h2><p>RudderStack sets the ID value in the cache to the <code>userId</code> or <code>anonymousId</code> present in the <a href="https://www.rudderstack.com/docs/event-spec/standard-events/identify/" ><code>identify</code></a> call.</p>
<p>A sample <code>identify</code> call is shown below:</p>
<div class="rs-code">
  <div class="rs-code__head">javascript<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-javascript" data-lang="javascript">rudderanalytics.identify(&#34;1hKOmRA4GRlm&#34;);</code></pre></div>
</div>
<p>The following table lists the RudderStack and Matomo property to set the <code>userId</code> in the <code>identify</code> call:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
          <th>Presence</th>
          <th>Matomo Method</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>userId</code>/<code>anonymousId</code></td>
          <td><code>userId</code></td>
          <td>Required</td>
          <td><code>_paq.push([&quot;setUserId&quot;,&quot;user_id&quot;])</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="track">Track</h2>
<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text">This destination does not strictly adhere to the <a href="https://www.rudderstack.com/docs/event-spec/ecommerce-events-spec/" >RudderStack Ecommerce Event Spec</a>.</div>
  </div>
</blockquote>
<p>The <a href="https://www.rudderstack.com/docs/event-spec/standard-events/track/" ><code>track</code></a> method lets you capture user events along with the properties associated with them.</p>
<p>A sample <code>track</code> call is shown below:</p>
<div class="rs-code">
  <div class="rs-code__head">javascript<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-javascript" data-lang="javascript">rudderanalytics.track(&#34;Order Completed&#34;,{
&#34;category&#34;: &#34;Orders&#34;,
&#34;action&#34;: &#34;Pass&#34;,
&#34;value&#34;: 15
});</code></pre></div>
</div>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="generic-events">Generic events</h3><p>RudderStack sends a generic <code>track</code> call which is a not a <a href="#standard-event" >standard event</a> or an <a href="#ecommerce-events" >ecommerce event</a> as a Matomo <a href="https://developer.matomo.org/guides/tracking-javascript-guide#manually-trigger-events" ><code>trackEvent</code></a> event.</p>
<p>The following table lists the property mappings between RudderStack and Matomo for <code>trackEvent</code>:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
          <th>Presence</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.category</code></td>
          <td><code>category</code></td>
          <td>Required</td>
      </tr>
      <tr>
          <td><code>properties.action</code></td>
          <td><code>action</code></td>
          <td>Required</td>
      </tr>
      <tr>
          <td><code>event</code></td>
          <td><code>name</code></td>
          <td>Optional</td>
      </tr>
      <tr>
          <td><code>properties.value</code></td>
          <td><code>value</code></td>
          <td>Optional</td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="standard-events">Standard events</h3>
<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text">For RudderStack to send an event as a standard Matomo event, you need to specify the event mapping under the <strong>Mapping to trigger the Matomo standard events for the respective Events</strong> setting in the RudderStack dashboard. For more information, refer to the <a href="#event-settings" >Event settings</a> section above.</div>
  </div>
</blockquote>
<p>RudderStack supports the following Matomo standard events:</p>
<ul>
<li><a href="https://developer.matomo.org/api-reference/tracking-javascript#:~:text=test%20content%20tracking.-,ping,-%28%29%20%2D%20Send%20a" >Ping</a></li>
<li><a href="https://developer.matomo.org/api-reference/tracking-javascript#:~:text=trackContentImpression" >Track Content Impressions</a></li>
<li><a href="https://developer.matomo.org/api-reference/tracking-javascript#:~:text=trackContentImpressionsWithinNode" >Track Content Impressions Within Node</a></li>
<li><a href="https://developer.matomo.org/api-reference/tracking-javascript#:~:text=trackContentInteraction" >Track Content Interaction</a></li>
<li><a href="https://developer.matomo.org/api-reference/tracking-javascript#:~:text=trackContentInteractionNode" >Track Content Interaction Node</a></li>
<li><a href="https://developer.matomo.org/api-reference/tracking-javascript#:~:text=custom%20revenue%20customRevenue.-,trackLink,-%28%20url%2C%20linkType%20%29" >Track Link</a></li>
<li><a href="https://developer.matomo.org/api-reference/tracking-javascript#:~:text=optional%20numeric%20value.-,trackSiteSearch,-%28keyword%2C%20%5Bcategory%5D%2C%20%5BresultsCount%29" >Track Site Search</a></li>
</ul>
<p>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.</p>

<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text">These properties should be present in the events for RudderStack to successfully send them to Matomo.</div>
  </div>
</blockquote>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="ping">Ping</h4><p>Use this event to send a ping request.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">The ping requests do not track new actions. Matomo ignores these requests if they&rsquo;re sent after a standard visit length.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="track-content-impressions">Track Content Impressions</h4><p>Use this event to track a content impression using the specified values.</p>
<p>RudderStack maps the following event properties to the Matomo standard event properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
          <th>Description</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.contentName</code></td>
          <td><code>contentName</code></td>
          <td>Represents a content block visible in the reports. One name can represent different content pieces.</td>
      </tr>
      <tr>
          <td><code>properties.contentPiece</code></td>
          <td><code>contentPiece</code></td>
          <td>Actual displayed content, for example, path to a video, image, etc.</td>
      </tr>
      <tr>
          <td><code>properties.contentTarget</code></td>
          <td><code>contentTarget</code></td>
          <td>URL of the landing page where the user was directed to after interacting with the block.</td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="track-content-impressions-within-node">Track Content Impressions Within Node</h4><p>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.</p>
<p>RudderStack maps the following event properties to the Matomo standard event properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.domId</code>/ <code>properties.dom_id</code></td>
          <td><code>domId</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="track-content-interaction">Track Content Interaction</h4><p>Use this event to track a content interaction with the specified values.</p>
<p>RudderStack maps the following event properties to the Matomo standard event properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.contentInteraction</code></td>
          <td><code>contentInteraction</code></td>
      </tr>
      <tr>
          <td><code>properties.contentName</code></td>
          <td><code>contentName</code></td>
      </tr>
      <tr>
          <td><code>properties.contentPiece</code></td>
          <td><code>contentPiece</code></td>
      </tr>
      <tr>
          <td><code>properties.contentTarget</code></td>
          <td><code>contentTarget</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="track-content-interaction-node">Track Content Interaction Node</h4><p>Use this event to track the interaction with a given DOM node or a content block.</p>
<p>RudderStack maps the following event properties to the Matomo standard event properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.domId</code>/ <code>properties.dom_id</code></td>
          <td><code>domId</code></td>
      </tr>
      <tr>
          <td><code>properties.contentInteraction</code></td>
          <td><code>contentInteraction</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="track-link">Track Link</h4><p>Use this event to log a click from your code.</p>
<p>RudderStack maps the following event properties to the Matomo standard event properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
          <th>Description</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.url</code>/ <code>message.context.page.url</code></td>
          <td><code>url</code></td>
          <td>The full URL to be tracked as a click.</td>
      </tr>
      <tr>
          <td><code>properties.linkType</code></td>
          <td><code>linkType</code></td>
          <td>Defines the link type. Can either be <code>link</code> for an outlink or <code>download</code> for the download link type.</td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="track-site-search">Track Site Search</h4><p>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.</p>
<p>RudderStack maps the following event properties to the Matomo standard event properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.keyword</code>/<code>properties.search</code>/<code>message.context.page.search</code></td>
          <td><code>keyword</code></td>
      </tr>
      <tr>
          <td><code>properties.category</code></td>
          <td><code>category</code></td>
      </tr>
      <tr>
          <td><code>properties.resultsCount</code></td>
          <td><code>resultsCount</code></td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="ecommerce-events">Ecommerce events</h3><p>RudderStack supports and maps the following <a href="https://www.rudderstack.com/docs/event-spec/ecommerce-events-spec/" >ecommerce events</a> to the corresponding Matomo <a href="https://developer.matomo.org/api-reference/tracking-javascript#ecommerce:~:text=most%20recent%20referrer.-,Ecommerce,-Matomo%20provides%20ecommerce" >ecommerce events</a>:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack Event</th>
          <th>Matomo Event</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>Product Viewed</code></td>
          <td><code>setEcommerceView</code></td>
      </tr>
      <tr>
          <td><code>Product Added</code></td>
          <td><code>addEcommerceItem</code></td>
      </tr>
      <tr>
          <td><code>Product Removed</code></td>
          <td><code>removeEcommerceItem</code></td>
      </tr>
      <tr>
          <td><code>Order Completed</code></td>
          <td><code>trackEcommerceOrder</code></td>
      </tr>
      <tr>
          <td><code>Cart Cleared</code></td>
          <td><code>clearEcommerceCart</code></td>
      </tr>
      <tr>
          <td><code>Update Cart</code></td>
          <td><code>trackEcommerceCartUpdate</code></td>
      </tr>
  </tbody>
</table>
<p>For the above-mentioned events, you can also send specific properties as mentioned in the following sections.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="product-viewed">Product Viewed</h4><p>RudderStack maps the <code>Product Viewed</code> event to [<code>setEcommerceView</code>](<a href="https://developer.matomo.org/api-reference/tracking-javascript#ecommerce:~:text=click%20here.-,setEcommerceView,-%28%20productSKU%2C%20productName%2C%20categoryName%29" >https://developer.matomo.org/api-reference/tracking-javascript#ecommerce:~:text=click%20here.-,setEcommerceView,-(%20productSKU%2C%20productName%2C%20categoryName)</a>. The following event properties are mapped to the Matomo properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
          <th>Presence</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.sku</code>/<code>properties.product_id</code></td>
          <td><code>productSKU</code></td>
          <td>Required</td>
      </tr>
      <tr>
          <td><code>properties.name</code></td>
          <td><code>productName</code></td>
          <td>Required</td>
      </tr>
      <tr>
          <td><code>properties.category</code></td>
          <td><code>categoryName</code></td>
          <td>Required</td>
      </tr>
      <tr>
          <td><code>properties.price</code> (Multiplied by quantity)</td>
          <td><code>price</code></td>
          <td>Required</td>
      </tr>
  </tbody>
</table>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">You can view the <code>Product Viewed</code> event in the Matomo dashboard only when it is followed by a <code>page</code> call.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="product-added">Product Added</h4><p>RudderStack maps the <code>Product Added</code> event name to [<code>addEcommerceItem</code>](<a href="https://developer.matomo.org/api-reference/tracking-javascript#ecommerce:~:text=category%20page%20view.-,addEcommerceItem,-%28%20productSKU%2C%20%5BproductName%5D%2C%20%5BproductCategory%29" >https://developer.matomo.org/api-reference/tracking-javascript#ecommerce:~:text=category%20page%20view.-,addEcommerceItem,-(%20productSKU%2C%20%5BproductName%5D%2C%20%5BproductCategory)</a>. The following event properties are mapped to the Matomo properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
          <th>Presence</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.sku</code>/<code>properties.product_id</code></td>
          <td><code>productSKU</code></td>
          <td>Required</td>
      </tr>
      <tr>
          <td><code>properties.name</code></td>
          <td><code>productName</code></td>
          <td>Optional</td>
      </tr>
      <tr>
          <td><code>properties.category</code></td>
          <td><code>categoryName</code></td>
          <td>Optional</td>
      </tr>
      <tr>
          <td><code>properties.price</code> (Multiplied by quantity)</td>
          <td><code>price</code></td>
          <td>Optional</td>
      </tr>
      <tr>
          <td><code>properties.quantity</code></td>
          <td><code>quantity</code></td>
          <td>Optional</td>
      </tr>
  </tbody>
</table>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">You can view the <code>Product Added</code> event in the Matomo dashboard only when it is followed by an <code>Update Cart</code> or <code>Order Completed</code> event.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="product-removed">Product Removed</h4><p>RudderStack maps the <code>Product Removed</code> event name to <a href="https://developer.matomo.org/api-reference/tracking-javascript#ecommerce:~:text=in%20the%20order.-,removeEcommerceItem,-%28%20productSKU%20%29%20%2D%20Remove" ><code>removeEcommerceItem</code></a>. The following event properties are mapped to the Matomo properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
          <th>Presence</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.sku</code>/<code>properties.product_id</code></td>
          <td><code>productSKU</code></td>
          <td>Required</td>
      </tr>
  </tbody>
</table>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">You can view the <code>Product Removed</code> event in the Matomo dashboard only when it is followed by an <code>Update Cart</code> or <code>Order Completed</code> event.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="order-completed">Order Completed</h4><p>RudderStack maps the <code>Order Completed</code> event name to [<code>trackEcommerceOrder</code>](<a href="https://developer.matomo.org/api-reference/tracking-javascript#ecommerce:~:text=from%20the%20cart.-,trackEcommerceOrder,-%28%20orderId%2C%20grandTotal%2C%20%5BsubTotal%29" >https://developer.matomo.org/api-reference/tracking-javascript#ecommerce:~:text=from%20the%20cart.-,trackEcommerceOrder,-(%20orderId%2C%20grandTotal%2C%20%5BsubTotal)</a>. The following event properties are mapped to the Matomo properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
          <th>Presence</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.order_id</code>/<code>properties.orderId</code></td>
          <td><code>orderId</code></td>
          <td>Required</td>
      </tr>
      <tr>
          <td><code>properties.total</code>/<code>properties.revenue</code></td>
          <td><code>grandTotal</code></td>
          <td>Required</td>
      </tr>
      <tr>
          <td><code>properties.subtotal</code></td>
          <td><code>subtotal</code></td>
          <td>Optional</td>
      </tr>
      <tr>
          <td><code>properties.tax</code></td>
          <td><code>tax</code></td>
          <td>Optional</td>
      </tr>
      <tr>
          <td><code>properties.shipping</code></td>
          <td><code>shipping</code></td>
          <td>Optional</td>
      </tr>
      <tr>
          <td><code>properties.discount</code></td>
          <td><code>discount</code></td>
          <td>Optional</td>
      </tr>
  </tbody>
</table>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text"><p><code>grandTotal</code> is not a default property in the <code>Order Completed</code> 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:</p>
<div class="rs-code">
  <div class="rs-code__head"><button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-text" data-lang="text">grandTotal = products[0].price * products[0].quantity + …
grandTotal += tax + shipping;</code></pre></div>
</div>
<p>Similarly, <code>subtotal</code> is calculated as the total value of all sales, excluding shipping and tax.</p>
</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="update-cart">Update Cart</h4>
<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">Although <code>Update Cart</code> is not a standard <a href="https://www.rudderstack.com/docs/event-spec/ecommerce-events-spec/" >RudderStack Ecommerce Event</a>, you can still send this event to update your cart and view the items that are currently present in it.</div>
  </div>
</blockquote>

</html>
<p>RudderStack also maps the <code>Update Cart</code> event name to <a href="https://developer.matomo.org/api-reference/tracking-javascript#ecommerce:~:text=trackEcommerceCartUpdate" ><code>trackEcommerceCartUpdate</code></a>. The following event properties are mapped to the Matomo properties:</p>
<table>
  <thead>
      <tr>
          <th>RudderStack property</th>
          <th>Matomo property</th>
          <th>Presence</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>properties.total/properties.revenue</code></td>
          <td><code>grandTotal</code></td>
          <td>Required</td>
      </tr>
  </tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="page">Page</h2><p>The <a href="https://www.rudderstack.com/docs/event-spec/standard-events/page/" ><code>page</code></a> call lets you record your website&rsquo;s page views with any additional relevant information about the viewed page.</p>
<p>A sample <code>page</code> call is shown below:</p>
<div class="rs-code">
  <div class="rs-code__head">javascript<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-javascript" data-lang="javascript">rudderanalytics.page(&#34;home&#34;,&#34;games&#34;);</code></pre></div>
</div>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">RudderStack does not consider any parameters inside the  <code>page</code> call and simply calls the  <code>trackPageView</code> event for each  <code>page</code> call.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="custom-dimensions">Custom dimensions</h2><p>Custom dimensions can be used to track any information related to any action or visitors.</p>

<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text">You can send the custom dimensions to Matomo only through the <code>track</code> calls.</div>
  </div>
</blockquote>
<p>RudderStack provides <code>customDimension</code> field which can be used inside the <code>integrations</code> object, as shown below:</p>
<div class="rs-code">
  <div class="rs-code__head">javascript<button class="rs-code__copy" type="button">
      
      Copy
    </button>
  </div>
  <div class="highlight"><pre class="chroma"><code class="language-javascript" data-lang="javascript">{
  integrations: {
    Matomo: {
      customDimension: [{
          dimensionId: &lt;dimension_ID&gt;,
          dimensionValue: &lt;dimension_value&gt;
        },
        {
          dimensionId: 1,
          dimensionValue: ENTERPRISE
        }
      ]
    }
  }
}</code></pre></div>
</div>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">Refer to the <a href="https://matomo.org/faq/reporting-tools/data-limits-for-custom-dimensions/" >Matomo help guide</a> to know about the data limitations for custom dimensions in Matomo.</div>
  </div>
</blockquote>

</html>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">RudderStack does not support sending custom variables to Matomo. Matomo recommends using custom dimensions instead. For more information, refer to this <a href="https://plugins.matomo.org/CustomVariables#description:~:text=This%20feature%20used%20to%20be%20part%20of%20Matomo.%20However%2C%20we%20no%20longer%20plan%20to%20further%20develop%20custom%20variables%20and%20only%20fix%20important%20bugs%20or%20security%20issues%20and%20we%20might%20stop%20supporting%20Custom%20Variables%20in%20the%20future" >Matomo page</a>.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="faq">FAQ</h2><!-- end-chunk -->
<!-- begin-chunk -->
<h4 id="where-can-i-find-the-server-url-and-site-id">Where can I find the Server URL and Site Id?</h4><p>To find the Matomo Server URL and Site Id:</p>
<ol>
<li>Log into your <a href="https://matomo.org/login" >Matomo dashboard</a>.</li>
<li>Go to <strong>Settings</strong> &gt; <strong>Website</strong> &gt; <strong>Tracking Code</strong>.</li>
<li>Under <strong>JavaScript Tracking Code</strong> section, you will find the below:</li>
</ol>

<figure class="image--main "  >
    <a 
         href="/docs/images/event-stream-destinations/matomo-dashboard.webp"
        
        >
        <img src="/docs/images/event-stream-destinations/matomo-dashboard.webp" 
         alt="Matomo dashboard"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<p>Here, the server URL: <code>https://rudderstacktest.matomo.cloud/</code> and site Id: <code>1</code></p>

