openapi: 3.2.0 info: title: Matomo Reporting API for plugin Sites Manager API version: 1.0.0 description: 'The SitesManager API gives you full control on Websites in Matomo (create, update and delete), and many methods to retrieve websites based on various attributes. This API lets you create websites via "addSite", update existing websites via "updateSite" and delete websites via "deleteSite". When creating websites, it can be useful to access internal codes used by Matomo for currencies via "getCurrencyList", or timezones via "getTimezonesList". There are also many ways to request a list of websites: from the website ID via "getSiteFromId" or the site URL via "getSitesIdFromSiteUrl". Often, the most useful technique is to list all websites that are known to a current user, based on the token_auth, via "getSitesWithAdminAccess", "getSitesWithViewAccess" or "getSitesWithAtLeastViewAccess" (which returns both). Some methods will affect all websites globally: "setGlobalExcludedIps" will set the list of IPs to be excluded on all websites, "setGlobalExcludedQueryParameters" will set the list of URL parameters to remove from URLs for all websites. The existing values can be fetched via "getExcludedIpsGlobal" and "getExcludedQueryParametersGlobal". See also the documentation about Managing Websites in Matomo.' servers: - url: https://demo-proxy.innocraft.cloud/ description: Current Matomo instance security: - MatomoToken: [] tags: - name: SitesManager description: 'The SitesManager API gives you full control on Websites in Matomo (create, update and delete), and many methods to retrieve websites based on various attributes. This API lets you create websites via "addSite", update existing websites via "updateSite" and delete websites via "deleteSite". When creating websites, it can be useful to access internal codes used by Matomo for currencies via "getCurrencyList", or timezones via "getTimezonesList". There are also many ways to request a list of websites: from the website ID via "getSiteFromId" or the site URL via "getSitesIdFromSiteUrl". Often, the most useful technique is to list all websites that are known to a current user, based on the token_auth, via "getSitesWithAdminAccess", "getSitesWithViewAccess" or "getSitesWithAtLeastViewAccess" (which returns both). Some methods will affect all websites globally: "setGlobalExcludedIps" will set the list of IPs to be excluded on all websites, "setGlobalExcludedQueryParameters" will set the list of URL parameters to remove from URLs for all websites. The existing values can be fetched via "getExcludedIpsGlobal" and "getExcludedQueryParametersGlobal". See also the documentation about Managing Websites in Matomo.' paths: /index.php?module=API&method=SitesManager.getJavascriptTag: get: tags: - SitesManager description: Returns the JavaScript tracking tag for the given website. operationId: SitesManager.getJavascriptTag parameters: - $ref: '#/components/parameters/formatOptional' - name: idSite in: query description: The numeric ID of the website to generate tracking code for. required: true schema: type: integer example: 1 - name: piwikUrl in: query description: The domain and URL path to the Matomo installation. Defaults to the current Matomo URL. required: false schema: type: string default: '' - name: mergeSubdomains in: query description: Whether to track visitors across all subdomains of the site. required: false schema: type: boolean default: false - name: groupPageTitlesByDomain in: query description: Whether to prepend the site domain to the page title when tracking. required: false schema: type: boolean default: false - name: mergeAliasUrls in: query description: Whether to treat alias URLs as part of the same website for outlink detection. required: false schema: type: boolean default: false - name: visitorCustomVariables in: query description: Custom visitor-scope variables as `array(array('name', 'value'), ...)`. required: false schema: type: array items: type: string default: [] - name: pageCustomVariables in: query description: Custom page-scope variables as `array(array('name', 'value'), ...)`. required: false schema: type: array items: type: string default: [] - name: customCampaignNameQueryParam in: query description: Custom campaign name query parameter name, overriding the default. required: false schema: type: string default: '' - name: customCampaignKeywordParam in: query description: Custom campaign keyword query parameter name, overriding the default. required: false schema: type: string default: '' - name: doNotTrack in: query description: Whether to respect the browser's Do-Not-Track setting. required: false schema: type: boolean default: false - name: disableCookies in: query description: Whether to disable all first-party cookies. required: false schema: type: boolean default: false - name: trackNoScript in: query description: Whether to include a `