setCustomRequestProcessing

The setCustomRequestProcessing() method lets you set up a function that will access and modify any query string before it will be sent as a request.

Syntax

setCustomRequestProcessing(queryProcessingFunction)
Not available
Not available
Not available
Not available
Not available
Not available

Parameters

queryProcessingFunction (function, required)

A function that accepts a query string and returns another query string.

Function queryProcessingFunction(originalQuery)

originalQuery (string, required)

Query string that will be sent by tracker if not modified.
Example: ping=6&idsite=45e07cbf-c8b3-42f3-a6d6-a5a176f623ef&rec=1&r=123456&h=12&m=0&s=0&url=https%3A%2F%2Fexample.com%2F&\_id=1234567890abcdef&\_idts=1660552750&\_idvc=87&\_idn=0&\_viewts=1660757889&send_image=0&ts_n=jstc_tm&ts_v=1.2.1&pdf=1&qt=0&realp=0&wma=0&dir=0&fla=0&java=0&gears=0&ag=0&cookie=1&res=1680x1050&dimension1=Disabled>\_ms=318&pv_id=abcdE1

Return (string, required)

Modified query string that will be sent by the tracker. If returned value will be empty string, then no request will be sent.

Examples

_paq.push([  
  "setCustomRequestProcessing",  
  function (query) {  
    var modifiedQuery = query.replace("rec=1", "rec=0");  
    return modifiedQuery;  
  },  
]);
Not available
Not available
Not available
Not available
Not available
Not available