Class MatomoRequest
MatomoTracker.- Author:
- brettcsorba
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMatomoRequest(Boolean required, Integer siteId, String actionName, String actionUrl, String apiVersion, VisitorId visitorId, Boolean newVisitor, String referrerUrl, CustomVariables visitCustomVariables, Integer visitorVisitCount, Instant visitorPreviousVisitTimestamp, Instant visitorFirstVisitTimestamp, String campaignName, String campaignKeyword, DeviceResolution deviceResolution, Integer currentHour, Integer currentMinute, Integer currentSecond, Boolean pluginFlash, Boolean pluginJava, Boolean pluginDirector, Boolean pluginQuicktime, Boolean pluginRealPlayer, Boolean pluginPDF, Boolean pluginWindowsMedia, Boolean pluginGears, Boolean pluginSilverlight, Boolean supportsCookies, String headerUserAgent, String clientHints, AcceptLanguage headerAcceptLanguage, String userId, VisitorId visitorCustomId, Boolean newVisit, CustomVariables pageCustomVariables, String outlinkUrl, String downloadUrl, String searchQuery, String searchCategory, Long searchResultsCount, UniqueId pageViewId, Integer goalId, Double ecommerceRevenue, Charset characterSet, Boolean customAction, Long networkTime, Long serverTime, Long transferTime, Long domProcessingTime, Long domCompletionTime, Long onloadTime, String eventCategory, String eventAction, String eventName, Double eventValue, String contentName, String contentPiece, String contentTarget, String contentInteraction, String ecommerceId, EcommerceItems ecommerceItems, Double ecommerceSubtotal, Double ecommerceTax, Double ecommerceShippingCost, Double ecommerceDiscount, Instant ecommerceLastOrderTimestamp, String ecommerceProductSku, String ecommerceProductName, String ecommerceProductCategory, Double ecommerceProductPrice, String authToken, String visitorIp, Instant requestTimestamp, Country visitorCountry, String visitorRegion, String visitorCity, Double visitorLatitude, Double visitorLongitude, Boolean queuedTracking, Boolean responseAsImage, Boolean ping, Boolean trackBotRequests, Integer botRecordingMode, Integer httpStatusCode, Long bandwidthBytes, String sourceLabel, RandomValue randomValue, Boolean debug, String mediaId, String mediaTitle, String mediaResource, String mediaType, String mediaPlayerName, Integer mediaTimeSpent, Integer mediaLength, Integer mediaProgressPercent, Integer mediaTimeToPlay, Integer mediaWidth, Integer mediaHeight, Boolean mediaFullscreen, String mediaSegmentsViewed, String crashMessage, String crashType, String crashCategory, String crashStackTrace, String crashLocation, Integer crashLine, Integer crashColumn, String sessionId, Map<Long, Object> dimensions, Map<String, Object> additionalParameters, Map<String, String> headers, Map<String, String> cookies) Creates a newMatomoRequestinstance. -
Method Summary
Modifier and TypeMethodDescriptionThe title of the action being tracked.The full URL for the current action.Allows you to specify additional HTTP request parameters that will be sent to Matomo.Defines the API version to use (default: 1).32 character authorization key used to authenticate the API request.The bandwidth used for the tracked request in bytes.Whenbots=1is set, this specifies the recording mode for bot requests.The campaign keyword (see Tracking Campaigns).The campaign name.The charset of the page being tracked.JSON-encoded User Agent Client Hints collected by JavaScript.The name of the interaction with the content.The name of the content.The actual content piece.The target of the content.Appends additional cookies to the request.Category of a crash to group crashes by.The column within the line where the crash occurred.The line number of the crash source, where the crash occurred.The originating source of the crash.Contains an error message describing the error that occurred during the last tracking request.A stack trace of the exception that occurred during the last tracking request.The type of exception that occurred during the last tracking request.The current hour (local time).The current minute (local time).The current second (local time).can be optionally sent along any tracking request that isn't a page view.getDebug()Meant to hold a random value that is generated before each request.The resolution of the device the visitor is using.Custom Dimension values for specific Custom Dimension IDs.How long it takes for the browser to load media and execute any Javascript code listening for the DOMContentLoaded event.How long the browser spends loading the webpage after the response was fully received until the user can start interacting with it.URL of a file the user has downloaded.Discount offered.The unique string identifier for the ecommerce order (required when tracking an ecommerce order).Items in the Ecommerce order.The UNIX timestamp of this customer's last ecommerce order.The category of the product being viewed.The name of the product being viewed.The price of the product being viewed.The SKU of the product being viewed.The grand total for the ecommerce order (required when tracking an ecommerce order).Shipping cost of the order.The subtotal of the order; excludes shipping.Tax amount of the order.An event action like Play, Pause, Duration, Add Playlist, Downloaded, Clicked...eg.The event name for example a Movie name, or Song name, or File name...Some numeric value that represents the event value.If specified, the tracking request will trigger a conversion for the goal of the website being tracked with this ID.An override value for the Accept-Language HTTP header field.You can set additional HTTP headers for the request sent to Matomo.An override value for the User-Agent HTTP header field.The HTTP status code of the tracked request.Whether the media is currently displayed in fullscreen.The height of the media player in pixels.A unique ID used to identify the media.The total duration / length of the media resource in seconds.The name of the media player used to play the media, e.g.The current progress of the media in percent (0–100).The URL of the media resource.A JSON-encoded array of which positions in the media were viewed by the visitor.The number of seconds the visitor has spent playing/watching the media resource so far.How many seconds it took before the media started playing.The title of the media resource.The type of media, e.g.The width of the media player in pixels.How long it took to connect to server.will force a new visit to be created for this action.Tracks if the visitor is a returning visitor.How long it takes the browser to execute Javascript code waiting for the window.load event.An external URL the user has opened.Custom variables are custom name-value pairs that you can assign to your visitors (or page views).Accepts a six character unique ID that identifies which actions were performed on a specific page view.getPing()If set to true, the request will be a Heartbeat request which will not track any new activity (such as a new visit, new action or new goal).Does the visitor use Director plugin.Does the visitor use the Adobe Flash Plugin.Does the visitor use a Gears plugin.Does the visitor use the Java plugin.Does the visitor use a PDF plugin.Does the visitor use Quicktime plugin.Does the visitor use Realplayer plugin.Does the visitor use a Silverlight plugin.Does the visitor use a Windows Media plugin.When set to false, the queued tracking handler won't be used and instead the tracking request will be executed directly.Meant to hold a random value that is generated before each request.The full HTTP Referrer URL.Override for the datetime of the request (normally the current time is used).The ID of the website we're tracking a visit/action for.If set to 0 (send_image=0) Matomo will respond with an HTTP 204 response code instead of a GIF image.When search is specified, you can optionally specify a search category with this parameter.The Site Search keyword.When search is specified, we also recommend setting the search_count to the number of search results displayed on the results page.How long it took the server to generate page.The Matomo session ID sent as a cookieMATOMO_SESSID.The ID of the website we're tracking a visit/action for.Defines the source of the tracking request (e.g.,"backend"or"mobile-app").Does the visitor's client is known to support cookies.By default, Matomo does not track bots.How long it takes the browser to download the response from the server.Defines the User ID for this request.Custom variables are custom name-value pairs that you can assign to your visitors (or page views).An override value for the city.An override value for the country.defines the visitor ID for this request.The UNIX timestamp of this visitor's first visit.The unique visitor ID.Override value for the visitor IP (both IPv4 and IPv6 notations supported).An override value for the visitor's latitude, eg 22.456.An override value for the visitor's longitude, eg 22.456.The UNIX timestamp of this visitor's previous visit.An override value for the region.The current count of visits for this visitor.request()voidsetActionName(String actionName) The title of the action being tracked.voidsetActionUrl(String actionUrl) The full URL for the current action.voidsetAdditionalParameters(Map<String, Object> additionalParameters) Allows you to specify additional HTTP request parameters that will be sent to Matomo.voidsetApiVersion(String apiVersion) Defines the API version to use (default: 1).voidsetAuthToken(String authToken) 32 character authorization key used to authenticate the API request.voidsetBandwidthBytes(Long bandwidthBytes) The bandwidth used for the tracked request in bytes.voidsetBotRecordingMode(Integer botRecordingMode) Whenbots=1is set, this specifies the recording mode for bot requests.voidsetCampaignKeyword(String campaignKeyword) The campaign keyword (see Tracking Campaigns).voidsetCampaignName(String campaignName) The campaign name.voidsetCharacterSet(Charset characterSet) The charset of the page being tracked.voidsetClientHints(String clientHints) JSON-encoded User Agent Client Hints collected by JavaScript.voidsetContentInteraction(String contentInteraction) The name of the interaction with the content.voidsetContentName(String contentName) The name of the content.voidsetContentPiece(String contentPiece) The actual content piece.voidsetContentTarget(String contentTarget) The target of the content.voidsetCookies(Map<String, String> cookies) Appends additional cookies to the request.voidsetCrashCategory(String crashCategory) Category of a crash to group crashes by.voidsetCrashColumn(Integer crashColumn) The column within the line where the crash occurred.voidsetCrashLine(Integer crashLine) The line number of the crash source, where the crash occurred.voidsetCrashLocation(String crashLocation) The originating source of the crash.voidsetCrashMessage(String crashMessage) Contains an error message describing the error that occurred during the last tracking request.voidsetCrashStackTrace(String crashStackTrace) A stack trace of the exception that occurred during the last tracking request.voidsetCrashType(String crashType) The type of exception that occurred during the last tracking request.voidsetCurrentHour(Integer currentHour) The current hour (local time).voidsetCurrentMinute(Integer currentMinute) The current minute (local time).voidsetCurrentSecond(Integer currentSecond) The current second (local time).voidsetCustomAction(Boolean customAction) can be optionally sent along any tracking request that isn't a page view.voidMeant to hold a random value that is generated before each request.voidsetDeviceResolution(DeviceResolution deviceResolution) The resolution of the device the visitor is using.voidsetDimensions(Map<Long, Object> dimensions) Custom Dimension values for specific Custom Dimension IDs.voidsetDomCompletionTime(Long domCompletionTime) How long it takes for the browser to load media and execute any Javascript code listening for the DOMContentLoaded event.voidsetDomProcessingTime(Long domProcessingTime) How long the browser spends loading the webpage after the response was fully received until the user can start interacting with it.voidsetDownloadUrl(String downloadUrl) URL of a file the user has downloaded.voidsetEcommerceDiscount(Double ecommerceDiscount) Discount offered.voidsetEcommerceId(String ecommerceId) The unique string identifier for the ecommerce order (required when tracking an ecommerce order).voidsetEcommerceItems(EcommerceItems ecommerceItems) Items in the Ecommerce order.voidsetEcommerceLastOrderTimestamp(Instant ecommerceLastOrderTimestamp) The UNIX timestamp of this customer's last ecommerce order.voidsetEcommerceProductCategory(String ecommerceProductCategory) The category of the product being viewed.voidsetEcommerceProductName(String ecommerceProductName) The name of the product being viewed.voidsetEcommerceProductPrice(Double ecommerceProductPrice) The price of the product being viewed.voidsetEcommerceProductSku(String ecommerceProductSku) The SKU of the product being viewed.voidsetEcommerceRevenue(Double ecommerceRevenue) The grand total for the ecommerce order (required when tracking an ecommerce order).voidsetEcommerceShippingCost(Double ecommerceShippingCost) Shipping cost of the order.voidsetEcommerceSubtotal(Double ecommerceSubtotal) The subtotal of the order; excludes shipping.voidsetEcommerceTax(Double ecommerceTax) Tax amount of the order.voidsetEventAction(String eventAction) An event action like Play, Pause, Duration, Add Playlist, Downloaded, Clicked...voidsetEventCategory(String eventCategory) eg.voidsetEventName(String eventName) The event name for example a Movie name, or Song name, or File name...voidsetEventValue(Double eventValue) Some numeric value that represents the event value.voidIf specified, the tracking request will trigger a conversion for the goal of the website being tracked with this ID.voidsetHeaderAcceptLanguage(AcceptLanguage headerAcceptLanguage) An override value for the Accept-Language HTTP header field.voidsetHeaders(Map<String, String> headers) You can set additional HTTP headers for the request sent to Matomo.voidsetHeaderUserAgent(String headerUserAgent) An override value for the User-Agent HTTP header field.voidsetHttpStatusCode(Integer httpStatusCode) The HTTP status code of the tracked request.voidsetMediaFullscreen(Boolean mediaFullscreen) Whether the media is currently displayed in fullscreen.voidsetMediaHeight(Integer mediaHeight) The height of the media player in pixels.voidsetMediaId(String mediaId) A unique ID used to identify the media.voidsetMediaLength(Integer mediaLength) The total duration / length of the media resource in seconds.voidsetMediaPlayerName(String mediaPlayerName) The name of the media player used to play the media, e.g.voidsetMediaProgressPercent(Integer mediaProgressPercent) The current progress of the media in percent (0–100).voidsetMediaResource(String mediaResource) The URL of the media resource.voidsetMediaSegmentsViewed(String mediaSegmentsViewed) A JSON-encoded array of which positions in the media were viewed by the visitor.voidsetMediaTimeSpent(Integer mediaTimeSpent) The number of seconds the visitor has spent playing/watching the media resource so far.voidsetMediaTimeToPlay(Integer mediaTimeToPlay) How many seconds it took before the media started playing.voidsetMediaTitle(String mediaTitle) The title of the media resource.voidsetMediaType(String mediaType) The type of media, e.g.voidsetMediaWidth(Integer mediaWidth) The width of the media player in pixels.voidsetNetworkTime(Long networkTime) How long it took to connect to server.voidsetNewVisit(Boolean newVisit) will force a new visit to be created for this action.voidsetNewVisitor(Boolean newVisitor) Tracks if the visitor is a returning visitor.voidsetOnloadTime(Long onloadTime) How long it takes the browser to execute Javascript code waiting for the window.load event.voidsetOutlinkUrl(String outlinkUrl) An external URL the user has opened.voidsetPageCustomVariables(CustomVariables pageCustomVariables) Custom variables are custom name-value pairs that you can assign to your visitors (or page views).voidsetPageViewId(UniqueId pageViewId) Accepts a six character unique ID that identifies which actions were performed on a specific page view.voidIf set to true, the request will be a Heartbeat request which will not track any new activity (such as a new visit, new action or new goal).voidsetPluginDirector(Boolean pluginDirector) Does the visitor use Director plugin.voidsetPluginFlash(Boolean pluginFlash) Does the visitor use the Adobe Flash Plugin.voidsetPluginGears(Boolean pluginGears) Does the visitor use a Gears plugin.voidsetPluginJava(Boolean pluginJava) Does the visitor use the Java plugin.voidsetPluginPDF(Boolean pluginPDF) Does the visitor use a PDF plugin.voidsetPluginQuicktime(Boolean pluginQuicktime) Does the visitor use Quicktime plugin.voidsetPluginRealPlayer(Boolean pluginRealPlayer) Does the visitor use Realplayer plugin.voidsetPluginSilverlight(Boolean pluginSilverlight) Does the visitor use a Silverlight plugin.voidsetPluginWindowsMedia(Boolean pluginWindowsMedia) Does the visitor use a Windows Media plugin.voidsetQueuedTracking(Boolean queuedTracking) When set to false, the queued tracking handler won't be used and instead the tracking request will be executed directly.voidsetRandomValue(RandomValue randomValue) Meant to hold a random value that is generated before each request.voidsetReferrerUrl(String referrerUrl) The full HTTP Referrer URL.voidsetRequestTimestamp(Instant requestTimestamp) Override for the datetime of the request (normally the current time is used).voidsetRequired(Boolean required) The ID of the website we're tracking a visit/action for.voidsetResponseAsImage(Boolean responseAsImage) If set to 0 (send_image=0) Matomo will respond with an HTTP 204 response code instead of a GIF image.voidsetSearchCategory(String searchCategory) When search is specified, you can optionally specify a search category with this parameter.voidsetSearchQuery(String searchQuery) The Site Search keyword.voidsetSearchResultsCount(Long searchResultsCount) When search is specified, we also recommend setting the search_count to the number of search results displayed on the results page.voidsetServerTime(Long serverTime) How long it took the server to generate page.voidsetSessionId(String sessionId) The Matomo session ID sent as a cookieMATOMO_SESSID.voidThe ID of the website we're tracking a visit/action for.voidsetSourceLabel(String sourceLabel) Defines the source of the tracking request (e.g.,"backend"or"mobile-app").voidsetSupportsCookies(Boolean supportsCookies) Does the visitor's client is known to support cookies.voidsetTrackBotRequests(Boolean trackBotRequests) By default, Matomo does not track bots.voidsetTransferTime(Long transferTime) How long it takes the browser to download the response from the server.voidDefines the User ID for this request.voidsetVisitCustomVariables(CustomVariables visitCustomVariables) Custom variables are custom name-value pairs that you can assign to your visitors (or page views).voidsetVisitorCity(String visitorCity) An override value for the city.voidsetVisitorCountry(Country visitorCountry) An override value for the country.voidsetVisitorCustomId(VisitorId visitorCustomId) defines the visitor ID for this request.voidsetVisitorFirstVisitTimestamp(Instant visitorFirstVisitTimestamp) The UNIX timestamp of this visitor's first visit.voidsetVisitorId(VisitorId visitorId) The unique visitor ID.voidsetVisitorIp(String visitorIp) Override value for the visitor IP (both IPv4 and IPv6 notations supported).voidsetVisitorLatitude(Double visitorLatitude) An override value for the visitor's latitude, eg 22.456.voidsetVisitorLongitude(Double visitorLongitude) An override value for the visitor's longitude, eg 22.456.voidsetVisitorPreviousVisitTimestamp(Instant visitorPreviousVisitTimestamp) The UNIX timestamp of this visitor's previous visit.voidsetVisitorRegion(String visitorRegion) An override value for the region.voidsetVisitorVisitCount(Integer visitorVisitCount) The current count of visits for this visitor.toString()
-
Constructor Details
-
MatomoRequest
public MatomoRequest() -
MatomoRequest
public MatomoRequest(Boolean required, Integer siteId, String actionName, String actionUrl, String apiVersion, VisitorId visitorId, Boolean newVisitor, String referrerUrl, CustomVariables visitCustomVariables, Integer visitorVisitCount, Instant visitorPreviousVisitTimestamp, Instant visitorFirstVisitTimestamp, String campaignName, String campaignKeyword, DeviceResolution deviceResolution, Integer currentHour, Integer currentMinute, Integer currentSecond, Boolean pluginFlash, Boolean pluginJava, Boolean pluginDirector, Boolean pluginQuicktime, Boolean pluginRealPlayer, Boolean pluginPDF, Boolean pluginWindowsMedia, Boolean pluginGears, Boolean pluginSilverlight, Boolean supportsCookies, String headerUserAgent, String clientHints, AcceptLanguage headerAcceptLanguage, String userId, VisitorId visitorCustomId, Boolean newVisit, CustomVariables pageCustomVariables, String outlinkUrl, String downloadUrl, String searchQuery, String searchCategory, Long searchResultsCount, UniqueId pageViewId, Integer goalId, Double ecommerceRevenue, Charset characterSet, Boolean customAction, Long networkTime, Long serverTime, Long transferTime, Long domProcessingTime, Long domCompletionTime, Long onloadTime, String eventCategory, String eventAction, String eventName, Double eventValue, String contentName, String contentPiece, String contentTarget, String contentInteraction, String ecommerceId, EcommerceItems ecommerceItems, Double ecommerceSubtotal, Double ecommerceTax, Double ecommerceShippingCost, Double ecommerceDiscount, Instant ecommerceLastOrderTimestamp, String ecommerceProductSku, String ecommerceProductName, String ecommerceProductCategory, Double ecommerceProductPrice, String authToken, String visitorIp, Instant requestTimestamp, Country visitorCountry, String visitorRegion, String visitorCity, Double visitorLatitude, Double visitorLongitude, Boolean queuedTracking, Boolean responseAsImage, Boolean ping, Boolean trackBotRequests, Integer botRecordingMode, Integer httpStatusCode, Long bandwidthBytes, String sourceLabel, RandomValue randomValue, Boolean debug, String mediaId, String mediaTitle, String mediaResource, String mediaType, String mediaPlayerName, Integer mediaTimeSpent, Integer mediaLength, Integer mediaProgressPercent, Integer mediaTimeToPlay, Integer mediaWidth, Integer mediaHeight, Boolean mediaFullscreen, String mediaSegmentsViewed, String crashMessage, String crashType, String crashCategory, String crashStackTrace, String crashLocation, Integer crashLine, Integer crashColumn, String sessionId, Map<Long, Object> dimensions, Map<String, Object> additionalParameters, Map<String, String> headers, Map<String, String> cookies) Creates a newMatomoRequestinstance.- Parameters:
required- The ID of the website we're tracking a visit/action for. Only needed, if no default site id is configured.siteId- The ID of the website we're tracking a visit/action for. Only needed, if no default site id is configured.actionName- The title of the action being tracked. For page tracks this is used as page title. If enabled in your installation you may use the category tree structure in this field. For example, "game / register new user" would then create a group "game" and add the item "register new user" in it.actionUrl- The full URL for the current action.apiVersion- Defines the API version to use (default: 1).visitorId- The unique visitor ID. SeeVisitorId. Default isVisitorId.random()Since version 3.0.0 this parameter is of type
VisitorIdand not a String anymore. UseVisitorId.fromHex(String)to create a VisitorId from a hex string,VisitorId.fromUUID(UUID)to create it from a UUID orVisitorId.fromHash(long)to create it from a long value.newVisitor- Tracks if the visitor is a returning visitor.This is done by storing a visitor ID in a 1st party cookie.
referrerUrl- The full HTTP Referrer URL. This value is used to determine how someone got to your website (ie, through a website, search engine or campaign)visitCustomVariables- Custom variables are custom name-value pairs that you can assign to your visitors (or page views).visitorVisitCount- The current count of visits for this visitor. To set this value correctly, it would be required to store the value for each visitor in your application (using sessions or persisting in a database). Then you would manually increment the counts by one on each new visit or "session", depending on how you choose to define a visit.visitorPreviousVisitTimestamp- The UNIX timestamp of this visitor's previous visit. This parameter is used to populate the report Visitors > Engagement > Visits by days since last visit.visitorFirstVisitTimestamp- The UNIX timestamp of this visitor's first visit. This could be set to the date where the user first started using your software/app, or when he/she created an account.campaignName- The campaign name. This parameter will only be used for the first pageview of a visit.campaignKeyword- The campaign keyword (see Tracking Campaigns). Used to populate the Referrers > Campaigns report (clicking on a campaign loads all keywords for this campaign). This parameter will only be used for the first pageview of a visit.deviceResolution- The resolution of the device the visitor is using.currentHour- The current hour (local time).currentMinute- The current minute (local time).currentSecond- The current second (local time).pluginFlash- Does the visitor use the Adobe Flash Plugin.pluginJava- Does the visitor use the Java plugin.pluginDirector- Does the visitor use Director plugin.pluginQuicktime- Does the visitor use Quicktime plugin.pluginRealPlayer- Does the visitor use Realplayer plugin.pluginPDF- Does the visitor use a PDF plugin.pluginWindowsMedia- Does the visitor use a Windows Media plugin.pluginGears- Does the visitor use a Gears plugin.pluginSilverlight- Does the visitor use a Silverlight plugin.supportsCookies- Does the visitor's client is known to support cookies.headerUserAgent- An override value for the User-Agent HTTP header field.clientHints- JSON-encoded User Agent Client Hints collected by JavaScript. Used to enrich the detected user agent data.Example:
{"brands":[{"brand":"Chromium","version":"110"}],"mobile":false}headerAcceptLanguage- An override value for the Accept-Language HTTP header field. This value is used to detect the visitor's country if GeoIP is not enabled.userId- Defines the User ID for this request. User ID is any non-empty unique string identifying the user (such as an email address or a username). When specified, the User ID will be "enforced". This means that if there is no recent visit with this User ID, a new one will be created. If a visit is found in the last 30 minutes with your specified User ID, then the new action will be recorded to this existing visit.visitorCustomId- defines the visitor ID for this request.newVisit- will force a new visit to be created for this action.pageCustomVariables- Custom variables are custom name-value pairs that you can assign to your visitors (or page views).outlinkUrl- An external URL the user has opened. Used for tracking outlink clicks. We recommend to also set the url parameter to this same value.downloadUrl- URL of a file the user has downloaded. Used for tracking downloads. We recommend to also set the url parameter to this same value.searchQuery- The Site Search keyword. When specified, the request will not be tracked as a normal pageview but will instead be tracked as a Site Search requestsearchCategory- When search is specified, you can optionally specify a search category with this parameter.searchResultsCount- When search is specified, we also recommend setting the search_count to the number of search results displayed on the results page. When keywords are tracked with &search_count=0 they will appear in the "No Result Search Keyword" report.pageViewId- Accepts a six character unique ID that identifies which actions were performed on a specific page view. When a page was viewed, all following tracking requests (such as events) during that page view should use the same pageview ID. Once another page was viewed a new unique ID should be generated. Use [0-9a-Z] as possible characters for the unique ID.goalId- If specified, the tracking request will trigger a conversion for the goal of the website being tracked with this ID. The value 0 tracks an ecommerce interaction.ecommerceRevenue- The grand total for the ecommerce order (required when tracking an ecommerce order).characterSet- The charset of the page being tracked. Specify the charset if the data you send to Matomo is encoded in a different character set than the default utf-8customAction- can be optionally sent along any tracking request that isn't a page view. For example, it can be sent together with an event tracking request. The advantage being that should you ever disable the event plugin, then the event tracking requests will be ignored vs if the parameter is not set, a page view would be tracked even though it isn't a page view.networkTime- How long it took to connect to server.serverTime- How long it took the server to generate page.transferTime- How long it takes the browser to download the response from the server.domProcessingTime- How long the browser spends loading the webpage after the response was fully received until the user can start interacting with it.domCompletionTime- How long it takes for the browser to load media and execute any Javascript code listening for the DOMContentLoaded event.onloadTime- How long it takes the browser to execute Javascript code waiting for the window.load event.eventCategory- eg. Videos, Music, Games...eventAction- An event action like Play, Pause, Duration, Add Playlist, Downloaded, Clicked...eventName- The event name for example a Movie name, or Song name, or File name...eventValue- Some numeric value that represents the event value.contentName- The name of the content. For instance 'Ad Foo Bar'contentPiece- The actual content piece. For instance the path to an image, video, audio, any textcontentTarget- The target of the content. For instance the URL of a landing pagecontentInteraction- The name of the interaction with the content. For instance a 'click'ecommerceId- The unique string identifier for the ecommerce order (required when tracking an ecommerce order).ecommerceItems- Items in the Ecommerce order.ecommerceSubtotal- The subtotal of the order; excludes shipping.ecommerceTax- Tax amount of the order.ecommerceShippingCost- Shipping cost of the order.ecommerceDiscount- Discount offered.ecommerceLastOrderTimestamp- The UNIX timestamp of this customer's last ecommerce order. This value is used to process the "Days since last order" report.ecommerceProductSku- The SKU of the product being viewed. Used for ecommerce product page tracking.Requires
idgoal=0and_pksto be set.ecommerceProductName- The name of the product being viewed. Used for ecommerce product page tracking.Requires
idgoal=0and_pksto be set.ecommerceProductCategory- The category of the product being viewed. Used for ecommerce product page tracking.Can be a string or a JSON-encoded array of up to five category names.
Requires
idgoal=0and_pksto be set.ecommerceProductPrice- The price of the product being viewed. Used for ecommerce product page tracking.Requires
idgoal=0and_pksto be set.authToken- 32 character authorization key used to authenticate the API request. We recommend to create a user specifically for accessing the Tracking API, and give the user only write permission on the website(s).visitorIp- Override value for the visitor IP (both IPv4 and IPv6 notations supported).requestTimestamp- Override for the datetime of the request (normally the current time is used). This can be used to record visits and page views in the past.visitorCountry- An override value for the country. Must be a two-letter ISO 3166 Alpha-2 country code.visitorRegion- An override value for the region. Should be set to a ISO 3166-2 region code, which are used by MaxMind's and DB-IP's GeoIP2 databases. See here for a list of them for every country.visitorCity- An override value for the city. The name of the city the visitor is located in, eg, Tokyo.visitorLatitude- An override value for the visitor's latitude, eg 22.456.visitorLongitude- An override value for the visitor's longitude, eg 22.456.queuedTracking- When set to false, the queued tracking handler won't be used and instead the tracking request will be executed directly. This can be useful when you need to debug a tracking problem or want to test that the tracking works in general.responseAsImage- If set to 0 (send_image=0) Matomo will respond with an HTTP 204 response code instead of a GIF image. This improves performance and can fix errors if images are not allowed to be obtained directly (like Chrome Apps). Available since Matomo 2.10.0Default is
falseping- If set to true, the request will be a Heartbeat request which will not track any new activity (such as a new visit, new action or new goal). The heartbeat request will only update the visit's total time to provide accurate "Visit duration" metric when this parameter is set. It won't record any other data. This means by sending an additional tracking request when the user leaves your site or app with &ping=1, you fix the issue where the time spent of the last page visited is reported as 0 seconds.trackBotRequests- By default, Matomo does not track bots. If you use the Tracking HTTP API directly, you may be interested in tracking bot requests.botRecordingMode- Whenbots=1is set, this specifies the recording mode for bot requests.Set to
1to record bot requests without triggering any goals, events or actions.httpStatusCode- The HTTP status code of the tracked request. Used with bot tracking.When tracking a bot visit, this can be set to the HTTP status code of the bot's request.
bandwidthBytes- The bandwidth used for the tracked request in bytes. Used with bot tracking.sourceLabel- Defines the source of the tracking request (e.g.,"backend"or"mobile-app").Used to classify where the tracking hit originated.
randomValue- Meant to hold a random value that is generated before each request. Using it helps avoid the tracking request being cached by the browser or a proxy.debug- Meant to hold a random value that is generated before each request. Using it helps avoid the tracking request being cached by the browser or a proxy.mediaId- A unique ID used to identify the media. Part of the Media Analytics plugin.mediaTitle- The title of the media resource. Part of the Media Analytics plugin.mediaResource- The URL of the media resource. Part of the Media Analytics plugin.mediaType- The type of media, e.g."video"or"audio". Part of the Media Analytics plugin.mediaPlayerName- The name of the media player used to play the media, e.g."html5". Part of the Media Analytics plugin.mediaTimeSpent- The number of seconds the visitor has spent playing/watching the media resource so far. Part of the Media Analytics plugin.mediaLength- The total duration / length of the media resource in seconds. Part of the Media Analytics plugin.mediaProgressPercent- The current progress of the media in percent (0–100). Part of the Media Analytics plugin.mediaTimeToPlay- How many seconds it took before the media started playing. Part of the Media Analytics plugin.mediaWidth- The width of the media player in pixels. Part of the Media Analytics plugin.mediaHeight- The height of the media player in pixels. Part of the Media Analytics plugin.mediaFullscreen- Whether the media is currently displayed in fullscreen. Part of the Media Analytics plugin.mediaSegmentsViewed- A JSON-encoded array of which positions in the media were viewed by the visitor. Part of the Media Analytics plugin.Example:
[[0,15],[30,44]]means the visitor watched segments 0–15s and 30–44s.crashMessage- Contains an error message describing the error that occurred during the last tracking request.Custom action must be enabled for this.
Required for crash analytics
crashType- The type of exception that occurred during the last tracking request.Custom action must be enabled for this.
Typically a fully qualified class name of the exception, e.g.
java.lang.NullPointerException.Optional for crash analytics
crashCategory- Category of a crash to group crashes by.Custom action must be enabled for this.
Optional for crash analytics
crashStackTrace- A stack trace of the exception that occurred during the last tracking request.Custom action must be enabled for this.
Optional for crash analytics
crashLocation- The originating source of the crash.Could be a source file URI or something similar
Custom action must be enabled for this.
Optional for crash analytics
crashLine- The line number of the crash source, where the crash occurred.Custom action must be enabled for this.
Optional for crash analytics
crashColumn- The column within the line where the crash occurred.Optional for crash analytics
sessionId- The Matomo session ID sent as a cookieMATOMO_SESSID.If not null a cookie with the name
MATOMO_SESSIDwill be sent with the value of this parameter.dimensions- Custom Dimension values for specific Custom Dimension IDs.Custom Dimensions plugin must be installed. See the Custom Dimensions guide. Requires Matomo at least 2.15.1
additionalParameters- Allows you to specify additional HTTP request parameters that will be sent to Matomo.For example, you can use this to set the Accept-Language header, or to set the Content-Type.
headers- You can set additional HTTP headers for the request sent to Matomo.For example, you can use this to set the Accept-Language header, or to set the Content-Type.
cookies- Appends additional cookies to the request.This allows you to add Matomo specific cookies, like
_pk_idor_pk_sesscoming from Matomo responses to the request.
-
-
Method Details
-
request
-
getRequired
The ID of the website we're tracking a visit/action for. Only needed, if no default site id is configured. -
getSiteId
The ID of the website we're tracking a visit/action for. Only needed, if no default site id is configured. -
getActionName
The title of the action being tracked. For page tracks this is used as page title. If enabled in your installation you may use the category tree structure in this field. For example, "game / register new user" would then create a group "game" and add the item "register new user" in it. -
getActionUrl
The full URL for the current action. -
getApiVersion
Defines the API version to use (default: 1). -
getVisitorId
The unique visitor ID. SeeVisitorId. Default isVisitorId.random()Since version 3.0.0 this parameter is of type
VisitorIdand not a String anymore. UseVisitorId.fromHex(String)to create a VisitorId from a hex string,VisitorId.fromUUID(UUID)to create it from a UUID orVisitorId.fromHash(long)to create it from a long value. -
getNewVisitor
Tracks if the visitor is a returning visitor.This is done by storing a visitor ID in a 1st party cookie.
-
getReferrerUrl
The full HTTP Referrer URL. This value is used to determine how someone got to your website (ie, through a website, search engine or campaign) -
getVisitCustomVariables
Custom variables are custom name-value pairs that you can assign to your visitors (or page views). -
getVisitorVisitCount
The current count of visits for this visitor. To set this value correctly, it would be required to store the value for each visitor in your application (using sessions or persisting in a database). Then you would manually increment the counts by one on each new visit or "session", depending on how you choose to define a visit. -
getVisitorPreviousVisitTimestamp
The UNIX timestamp of this visitor's previous visit. This parameter is used to populate the report Visitors > Engagement > Visits by days since last visit. -
getVisitorFirstVisitTimestamp
The UNIX timestamp of this visitor's first visit. This could be set to the date where the user first started using your software/app, or when he/she created an account. -
getCampaignName
The campaign name. This parameter will only be used for the first pageview of a visit. -
getCampaignKeyword
The campaign keyword (see Tracking Campaigns). Used to populate the Referrers > Campaigns report (clicking on a campaign loads all keywords for this campaign). This parameter will only be used for the first pageview of a visit. -
getDeviceResolution
The resolution of the device the visitor is using. -
getCurrentHour
The current hour (local time). -
getCurrentMinute
The current minute (local time). -
getCurrentSecond
The current second (local time). -
getPluginFlash
Does the visitor use the Adobe Flash Plugin. -
getPluginJava
Does the visitor use the Java plugin. -
getPluginDirector
Does the visitor use Director plugin. -
getPluginQuicktime
Does the visitor use Quicktime plugin. -
getPluginRealPlayer
Does the visitor use Realplayer plugin. -
getPluginPDF
Does the visitor use a PDF plugin. -
getPluginWindowsMedia
Does the visitor use a Windows Media plugin. -
getPluginGears
Does the visitor use a Gears plugin. -
getPluginSilverlight
Does the visitor use a Silverlight plugin. -
getSupportsCookies
Does the visitor's client is known to support cookies. -
getHeaderUserAgent
An override value for the User-Agent HTTP header field. -
getClientHints
JSON-encoded User Agent Client Hints collected by JavaScript. Used to enrich the detected user agent data.Example:
{"brands":[{"brand":"Chromium","version":"110"}],"mobile":false} -
getHeaderAcceptLanguage
An override value for the Accept-Language HTTP header field. This value is used to detect the visitor's country if GeoIP is not enabled. -
getUserId
Defines the User ID for this request. User ID is any non-empty unique string identifying the user (such as an email address or a username). When specified, the User ID will be "enforced". This means that if there is no recent visit with this User ID, a new one will be created. If a visit is found in the last 30 minutes with your specified User ID, then the new action will be recorded to this existing visit. -
getVisitorCustomId
defines the visitor ID for this request. -
getNewVisit
will force a new visit to be created for this action. -
getPageCustomVariables
Custom variables are custom name-value pairs that you can assign to your visitors (or page views). -
getOutlinkUrl
An external URL the user has opened. Used for tracking outlink clicks. We recommend to also set the url parameter to this same value. -
getDownloadUrl
URL of a file the user has downloaded. Used for tracking downloads. We recommend to also set the url parameter to this same value. -
getSearchQuery
The Site Search keyword. When specified, the request will not be tracked as a normal pageview but will instead be tracked as a Site Search request -
getSearchCategory
When search is specified, you can optionally specify a search category with this parameter. -
getSearchResultsCount
When search is specified, we also recommend setting the search_count to the number of search results displayed on the results page. When keywords are tracked with &search_count=0 they will appear in the "No Result Search Keyword" report. -
getPageViewId
Accepts a six character unique ID that identifies which actions were performed on a specific page view. When a page was viewed, all following tracking requests (such as events) during that page view should use the same pageview ID. Once another page was viewed a new unique ID should be generated. Use [0-9a-Z] as possible characters for the unique ID. -
getGoalId
If specified, the tracking request will trigger a conversion for the goal of the website being tracked with this ID. The value 0 tracks an ecommerce interaction. -
getEcommerceRevenue
The grand total for the ecommerce order (required when tracking an ecommerce order). -
getCharacterSet
The charset of the page being tracked. Specify the charset if the data you send to Matomo is encoded in a different character set than the default utf-8 -
getCustomAction
can be optionally sent along any tracking request that isn't a page view. For example, it can be sent together with an event tracking request. The advantage being that should you ever disable the event plugin, then the event tracking requests will be ignored vs if the parameter is not set, a page view would be tracked even though it isn't a page view. -
getNetworkTime
How long it took to connect to server. -
getServerTime
How long it took the server to generate page. -
getTransferTime
How long it takes the browser to download the response from the server. -
getDomProcessingTime
How long the browser spends loading the webpage after the response was fully received until the user can start interacting with it. -
getDomCompletionTime
How long it takes for the browser to load media and execute any Javascript code listening for the DOMContentLoaded event. -
getOnloadTime
How long it takes the browser to execute Javascript code waiting for the window.load event. -
getEventCategory
eg. Videos, Music, Games... -
getEventAction
An event action like Play, Pause, Duration, Add Playlist, Downloaded, Clicked... -
getEventName
The event name for example a Movie name, or Song name, or File name... -
getEventValue
Some numeric value that represents the event value. -
getContentName
The name of the content. For instance 'Ad Foo Bar' -
getContentPiece
The actual content piece. For instance the path to an image, video, audio, any text -
getContentTarget
The target of the content. For instance the URL of a landing page -
getContentInteraction
The name of the interaction with the content. For instance a 'click' -
getEcommerceId
The unique string identifier for the ecommerce order (required when tracking an ecommerce order). -
getEcommerceItems
Items in the Ecommerce order. -
getEcommerceSubtotal
The subtotal of the order; excludes shipping. -
getEcommerceTax
Tax amount of the order. -
getEcommerceShippingCost
Shipping cost of the order. -
getEcommerceDiscount
Discount offered. -
getEcommerceLastOrderTimestamp
The UNIX timestamp of this customer's last ecommerce order. This value is used to process the "Days since last order" report. -
getEcommerceProductSku
The SKU of the product being viewed. Used for ecommerce product page tracking.Requires
idgoal=0and_pksto be set. -
getEcommerceProductName
The name of the product being viewed. Used for ecommerce product page tracking.Requires
idgoal=0and_pksto be set. -
getEcommerceProductCategory
The category of the product being viewed. Used for ecommerce product page tracking.Can be a string or a JSON-encoded array of up to five category names.
Requires
idgoal=0and_pksto be set. -
getEcommerceProductPrice
The price of the product being viewed. Used for ecommerce product page tracking.Requires
idgoal=0and_pksto be set. -
getAuthToken
32 character authorization key used to authenticate the API request. We recommend to create a user specifically for accessing the Tracking API, and give the user only write permission on the website(s). -
getVisitorIp
Override value for the visitor IP (both IPv4 and IPv6 notations supported). -
getRequestTimestamp
Override for the datetime of the request (normally the current time is used). This can be used to record visits and page views in the past. -
getVisitorCountry
An override value for the country. Must be a two-letter ISO 3166 Alpha-2 country code. -
getVisitorRegion
An override value for the region. Should be set to a ISO 3166-2 region code, which are used by MaxMind's and DB-IP's GeoIP2 databases. See here for a list of them for every country. -
getVisitorCity
An override value for the city. The name of the city the visitor is located in, eg, Tokyo. -
getVisitorLatitude
An override value for the visitor's latitude, eg 22.456. -
getVisitorLongitude
An override value for the visitor's longitude, eg 22.456. -
getQueuedTracking
When set to false, the queued tracking handler won't be used and instead the tracking request will be executed directly. This can be useful when you need to debug a tracking problem or want to test that the tracking works in general. -
getResponseAsImage
If set to 0 (send_image=0) Matomo will respond with an HTTP 204 response code instead of a GIF image. This improves performance and can fix errors if images are not allowed to be obtained directly (like Chrome Apps). Available since Matomo 2.10.0Default is
false -
getPing
If set to true, the request will be a Heartbeat request which will not track any new activity (such as a new visit, new action or new goal). The heartbeat request will only update the visit's total time to provide accurate "Visit duration" metric when this parameter is set. It won't record any other data. This means by sending an additional tracking request when the user leaves your site or app with &ping=1, you fix the issue where the time spent of the last page visited is reported as 0 seconds. -
getTrackBotRequests
By default, Matomo does not track bots. If you use the Tracking HTTP API directly, you may be interested in tracking bot requests. -
getBotRecordingMode
Whenbots=1is set, this specifies the recording mode for bot requests.Set to
1to record bot requests without triggering any goals, events or actions. -
getHttpStatusCode
The HTTP status code of the tracked request. Used with bot tracking.When tracking a bot visit, this can be set to the HTTP status code of the bot's request.
-
getBandwidthBytes
The bandwidth used for the tracked request in bytes. Used with bot tracking. -
getSourceLabel
Defines the source of the tracking request (e.g.,"backend"or"mobile-app").Used to classify where the tracking hit originated.
-
getRandomValue
Meant to hold a random value that is generated before each request. Using it helps avoid the tracking request being cached by the browser or a proxy. -
getDebug
Meant to hold a random value that is generated before each request. Using it helps avoid the tracking request being cached by the browser or a proxy. -
getMediaId
A unique ID used to identify the media. Part of the Media Analytics plugin. -
getMediaTitle
The title of the media resource. Part of the Media Analytics plugin. -
getMediaResource
The URL of the media resource. Part of the Media Analytics plugin. -
getMediaType
-
getMediaPlayerName
The name of the media player used to play the media, e.g."html5". Part of the Media Analytics plugin. -
getMediaTimeSpent
The number of seconds the visitor has spent playing/watching the media resource so far. Part of the Media Analytics plugin. -
getMediaLength
The total duration / length of the media resource in seconds. Part of the Media Analytics plugin. -
getMediaProgressPercent
The current progress of the media in percent (0–100). Part of the Media Analytics plugin. -
getMediaTimeToPlay
How many seconds it took before the media started playing. Part of the Media Analytics plugin. -
getMediaWidth
The width of the media player in pixels. Part of the Media Analytics plugin. -
getMediaHeight
The height of the media player in pixels. Part of the Media Analytics plugin. -
getMediaFullscreen
Whether the media is currently displayed in fullscreen. Part of the Media Analytics plugin. -
getMediaSegmentsViewed
A JSON-encoded array of which positions in the media were viewed by the visitor. Part of the Media Analytics plugin.Example:
[[0,15],[30,44]]means the visitor watched segments 0–15s and 30–44s. -
getCrashMessage
Contains an error message describing the error that occurred during the last tracking request.Custom action must be enabled for this.
Required for crash analytics
-
getCrashType
The type of exception that occurred during the last tracking request.Custom action must be enabled for this.
Typically a fully qualified class name of the exception, e.g.
java.lang.NullPointerException.Optional for crash analytics
-
getCrashCategory
Category of a crash to group crashes by.Custom action must be enabled for this.
Optional for crash analytics
-
getCrashStackTrace
A stack trace of the exception that occurred during the last tracking request.Custom action must be enabled for this.
Optional for crash analytics
-
getCrashLocation
The originating source of the crash.Could be a source file URI or something similar
Custom action must be enabled for this.
Optional for crash analytics
-
getCrashLine
The line number of the crash source, where the crash occurred.Custom action must be enabled for this.
Optional for crash analytics
-
getCrashColumn
The column within the line where the crash occurred.Optional for crash analytics
-
getSessionId
The Matomo session ID sent as a cookieMATOMO_SESSID.If not null a cookie with the name
MATOMO_SESSIDwill be sent with the value of this parameter. -
getDimensions
Custom Dimension values for specific Custom Dimension IDs.Custom Dimensions plugin must be installed. See the Custom Dimensions guide. Requires Matomo at least 2.15.1
-
getAdditionalParameters
Allows you to specify additional HTTP request parameters that will be sent to Matomo.For example, you can use this to set the Accept-Language header, or to set the Content-Type.
-
getHeaders
You can set additional HTTP headers for the request sent to Matomo.For example, you can use this to set the Accept-Language header, or to set the Content-Type.
-
getCookies
Appends additional cookies to the request.This allows you to add Matomo specific cookies, like
_pk_idor_pk_sesscoming from Matomo responses to the request. -
setRequired
The ID of the website we're tracking a visit/action for. Only needed, if no default site id is configured. -
setSiteId
The ID of the website we're tracking a visit/action for. Only needed, if no default site id is configured. -
setActionName
The title of the action being tracked. For page tracks this is used as page title. If enabled in your installation you may use the category tree structure in this field. For example, "game / register new user" would then create a group "game" and add the item "register new user" in it. -
setActionUrl
The full URL for the current action. -
setApiVersion
Defines the API version to use (default: 1). -
setVisitorId
The unique visitor ID. SeeVisitorId. Default isVisitorId.random()Since version 3.0.0 this parameter is of type
VisitorIdand not a String anymore. UseVisitorId.fromHex(String)to create a VisitorId from a hex string,VisitorId.fromUUID(UUID)to create it from a UUID orVisitorId.fromHash(long)to create it from a long value. -
setNewVisitor
Tracks if the visitor is a returning visitor.This is done by storing a visitor ID in a 1st party cookie.
-
setReferrerUrl
The full HTTP Referrer URL. This value is used to determine how someone got to your website (ie, through a website, search engine or campaign) -
setVisitCustomVariables
Custom variables are custom name-value pairs that you can assign to your visitors (or page views). -
setVisitorVisitCount
The current count of visits for this visitor. To set this value correctly, it would be required to store the value for each visitor in your application (using sessions or persisting in a database). Then you would manually increment the counts by one on each new visit or "session", depending on how you choose to define a visit. -
setVisitorPreviousVisitTimestamp
The UNIX timestamp of this visitor's previous visit. This parameter is used to populate the report Visitors > Engagement > Visits by days since last visit. -
setVisitorFirstVisitTimestamp
The UNIX timestamp of this visitor's first visit. This could be set to the date where the user first started using your software/app, or when he/she created an account. -
setCampaignName
The campaign name. This parameter will only be used for the first pageview of a visit. -
setCampaignKeyword
The campaign keyword (see Tracking Campaigns). Used to populate the Referrers > Campaigns report (clicking on a campaign loads all keywords for this campaign). This parameter will only be used for the first pageview of a visit. -
setDeviceResolution
The resolution of the device the visitor is using. -
setCurrentHour
The current hour (local time). -
setCurrentMinute
The current minute (local time). -
setCurrentSecond
The current second (local time). -
setPluginFlash
Does the visitor use the Adobe Flash Plugin. -
setPluginJava
Does the visitor use the Java plugin. -
setPluginDirector
Does the visitor use Director plugin. -
setPluginQuicktime
Does the visitor use Quicktime plugin. -
setPluginRealPlayer
Does the visitor use Realplayer plugin. -
setPluginPDF
Does the visitor use a PDF plugin. -
setPluginWindowsMedia
Does the visitor use a Windows Media plugin. -
setPluginGears
Does the visitor use a Gears plugin. -
setPluginSilverlight
Does the visitor use a Silverlight plugin. -
setSupportsCookies
Does the visitor's client is known to support cookies. -
setHeaderUserAgent
An override value for the User-Agent HTTP header field. -
setClientHints
JSON-encoded User Agent Client Hints collected by JavaScript. Used to enrich the detected user agent data.Example:
{"brands":[{"brand":"Chromium","version":"110"}],"mobile":false} -
setHeaderAcceptLanguage
An override value for the Accept-Language HTTP header field. This value is used to detect the visitor's country if GeoIP is not enabled. -
setUserId
Defines the User ID for this request. User ID is any non-empty unique string identifying the user (such as an email address or a username). When specified, the User ID will be "enforced". This means that if there is no recent visit with this User ID, a new one will be created. If a visit is found in the last 30 minutes with your specified User ID, then the new action will be recorded to this existing visit. -
setVisitorCustomId
defines the visitor ID for this request. -
setNewVisit
will force a new visit to be created for this action. -
setPageCustomVariables
Custom variables are custom name-value pairs that you can assign to your visitors (or page views). -
setOutlinkUrl
An external URL the user has opened. Used for tracking outlink clicks. We recommend to also set the url parameter to this same value. -
setDownloadUrl
URL of a file the user has downloaded. Used for tracking downloads. We recommend to also set the url parameter to this same value. -
setSearchQuery
The Site Search keyword. When specified, the request will not be tracked as a normal pageview but will instead be tracked as a Site Search request -
setSearchCategory
When search is specified, you can optionally specify a search category with this parameter. -
setSearchResultsCount
When search is specified, we also recommend setting the search_count to the number of search results displayed on the results page. When keywords are tracked with &search_count=0 they will appear in the "No Result Search Keyword" report. -
setPageViewId
Accepts a six character unique ID that identifies which actions were performed on a specific page view. When a page was viewed, all following tracking requests (such as events) during that page view should use the same pageview ID. Once another page was viewed a new unique ID should be generated. Use [0-9a-Z] as possible characters for the unique ID. -
setGoalId
If specified, the tracking request will trigger a conversion for the goal of the website being tracked with this ID. The value 0 tracks an ecommerce interaction. -
setEcommerceRevenue
The grand total for the ecommerce order (required when tracking an ecommerce order). -
setCharacterSet
The charset of the page being tracked. Specify the charset if the data you send to Matomo is encoded in a different character set than the default utf-8 -
setCustomAction
can be optionally sent along any tracking request that isn't a page view. For example, it can be sent together with an event tracking request. The advantage being that should you ever disable the event plugin, then the event tracking requests will be ignored vs if the parameter is not set, a page view would be tracked even though it isn't a page view. -
setNetworkTime
How long it took to connect to server. -
setServerTime
How long it took the server to generate page. -
setTransferTime
How long it takes the browser to download the response from the server. -
setDomProcessingTime
How long the browser spends loading the webpage after the response was fully received until the user can start interacting with it. -
setDomCompletionTime
How long it takes for the browser to load media and execute any Javascript code listening for the DOMContentLoaded event. -
setOnloadTime
How long it takes the browser to execute Javascript code waiting for the window.load event. -
setEventCategory
eg. Videos, Music, Games... -
setEventAction
An event action like Play, Pause, Duration, Add Playlist, Downloaded, Clicked... -
setEventName
The event name for example a Movie name, or Song name, or File name... -
setEventValue
Some numeric value that represents the event value. -
setContentName
The name of the content. For instance 'Ad Foo Bar' -
setContentPiece
The actual content piece. For instance the path to an image, video, audio, any text -
setContentTarget
The target of the content. For instance the URL of a landing page -
setContentInteraction
The name of the interaction with the content. For instance a 'click' -
setEcommerceId
The unique string identifier for the ecommerce order (required when tracking an ecommerce order). -
setEcommerceItems
Items in the Ecommerce order. -
setEcommerceSubtotal
The subtotal of the order; excludes shipping. -
setEcommerceTax
Tax amount of the order. -
setEcommerceShippingCost
Shipping cost of the order. -
setEcommerceDiscount
Discount offered. -
setEcommerceLastOrderTimestamp
The UNIX timestamp of this customer's last ecommerce order. This value is used to process the "Days since last order" report. -
setEcommerceProductSku
The SKU of the product being viewed. Used for ecommerce product page tracking.Requires
idgoal=0and_pksto be set. -
setEcommerceProductName
The name of the product being viewed. Used for ecommerce product page tracking.Requires
idgoal=0and_pksto be set. -
setEcommerceProductCategory
The category of the product being viewed. Used for ecommerce product page tracking.Can be a string or a JSON-encoded array of up to five category names.
Requires
idgoal=0and_pksto be set. -
setEcommerceProductPrice
The price of the product being viewed. Used for ecommerce product page tracking.Requires
idgoal=0and_pksto be set. -
setAuthToken
32 character authorization key used to authenticate the API request. We recommend to create a user specifically for accessing the Tracking API, and give the user only write permission on the website(s). -
setVisitorIp
Override value for the visitor IP (both IPv4 and IPv6 notations supported). -
setRequestTimestamp
Override for the datetime of the request (normally the current time is used). This can be used to record visits and page views in the past. -
setVisitorCountry
An override value for the country. Must be a two-letter ISO 3166 Alpha-2 country code. -
setVisitorRegion
An override value for the region. Should be set to a ISO 3166-2 region code, which are used by MaxMind's and DB-IP's GeoIP2 databases. See here for a list of them for every country. -
setVisitorCity
An override value for the city. The name of the city the visitor is located in, eg, Tokyo. -
setVisitorLatitude
An override value for the visitor's latitude, eg 22.456. -
setVisitorLongitude
An override value for the visitor's longitude, eg 22.456. -
setQueuedTracking
When set to false, the queued tracking handler won't be used and instead the tracking request will be executed directly. This can be useful when you need to debug a tracking problem or want to test that the tracking works in general. -
setResponseAsImage
If set to 0 (send_image=0) Matomo will respond with an HTTP 204 response code instead of a GIF image. This improves performance and can fix errors if images are not allowed to be obtained directly (like Chrome Apps). Available since Matomo 2.10.0Default is
false -
setPing
If set to true, the request will be a Heartbeat request which will not track any new activity (such as a new visit, new action or new goal). The heartbeat request will only update the visit's total time to provide accurate "Visit duration" metric when this parameter is set. It won't record any other data. This means by sending an additional tracking request when the user leaves your site or app with &ping=1, you fix the issue where the time spent of the last page visited is reported as 0 seconds. -
setTrackBotRequests
By default, Matomo does not track bots. If you use the Tracking HTTP API directly, you may be interested in tracking bot requests. -
setBotRecordingMode
Whenbots=1is set, this specifies the recording mode for bot requests.Set to
1to record bot requests without triggering any goals, events or actions. -
setHttpStatusCode
The HTTP status code of the tracked request. Used with bot tracking.When tracking a bot visit, this can be set to the HTTP status code of the bot's request.
-
setBandwidthBytes
The bandwidth used for the tracked request in bytes. Used with bot tracking. -
setSourceLabel
Defines the source of the tracking request (e.g.,"backend"or"mobile-app").Used to classify where the tracking hit originated.
-
setRandomValue
Meant to hold a random value that is generated before each request. Using it helps avoid the tracking request being cached by the browser or a proxy. -
setDebug
Meant to hold a random value that is generated before each request. Using it helps avoid the tracking request being cached by the browser or a proxy. -
setMediaId
A unique ID used to identify the media. Part of the Media Analytics plugin. -
setMediaTitle
The title of the media resource. Part of the Media Analytics plugin. -
setMediaResource
The URL of the media resource. Part of the Media Analytics plugin. -
setMediaType
-
setMediaPlayerName
The name of the media player used to play the media, e.g."html5". Part of the Media Analytics plugin. -
setMediaTimeSpent
The number of seconds the visitor has spent playing/watching the media resource so far. Part of the Media Analytics plugin. -
setMediaLength
The total duration / length of the media resource in seconds. Part of the Media Analytics plugin. -
setMediaProgressPercent
The current progress of the media in percent (0–100). Part of the Media Analytics plugin. -
setMediaTimeToPlay
How many seconds it took before the media started playing. Part of the Media Analytics plugin. -
setMediaWidth
The width of the media player in pixels. Part of the Media Analytics plugin. -
setMediaHeight
The height of the media player in pixels. Part of the Media Analytics plugin. -
setMediaFullscreen
Whether the media is currently displayed in fullscreen. Part of the Media Analytics plugin. -
setMediaSegmentsViewed
A JSON-encoded array of which positions in the media were viewed by the visitor. Part of the Media Analytics plugin.Example:
[[0,15],[30,44]]means the visitor watched segments 0–15s and 30–44s. -
setCrashMessage
Contains an error message describing the error that occurred during the last tracking request.Custom action must be enabled for this.
Required for crash analytics
-
setCrashType
The type of exception that occurred during the last tracking request.Custom action must be enabled for this.
Typically a fully qualified class name of the exception, e.g.
java.lang.NullPointerException.Optional for crash analytics
-
setCrashCategory
Category of a crash to group crashes by.Custom action must be enabled for this.
Optional for crash analytics
-
setCrashStackTrace
A stack trace of the exception that occurred during the last tracking request.Custom action must be enabled for this.
Optional for crash analytics
-
setCrashLocation
The originating source of the crash.Could be a source file URI or something similar
Custom action must be enabled for this.
Optional for crash analytics
-
setCrashLine
The line number of the crash source, where the crash occurred.Custom action must be enabled for this.
Optional for crash analytics
-
setCrashColumn
The column within the line where the crash occurred.Optional for crash analytics
-
setSessionId
The Matomo session ID sent as a cookieMATOMO_SESSID.If not null a cookie with the name
MATOMO_SESSIDwill be sent with the value of this parameter. -
setDimensions
Custom Dimension values for specific Custom Dimension IDs.Custom Dimensions plugin must be installed. See the Custom Dimensions guide. Requires Matomo at least 2.15.1
-
setAdditionalParameters
Allows you to specify additional HTTP request parameters that will be sent to Matomo.For example, you can use this to set the Accept-Language header, or to set the Content-Type.
-
setHeaders
You can set additional HTTP headers for the request sent to Matomo.For example, you can use this to set the Accept-Language header, or to set the Content-Type.
-
setCookies
Appends additional cookies to the request.This allows you to add Matomo specific cookies, like
_pk_idor_pk_sesscoming from Matomo responses to the request. -
toString
-