[IMP] website: add X-Disable-Tracking header to improve tracking
In this commit we add a request header X-Disable-Tracking that enables the client to ask the server not to track a request. This is useful for example when the client prefetches pages to be able to work offline. In that case, the prefetched pages must not be considered as viewed by the user. In such scenario and without such header, it is not possible to get an accurate page tracking. Task-2476513 Part-of: odoo/odoo#86031
This commit is contained in:
@@ -133,7 +133,7 @@ class Http(models.AbstractModel):
|
||||
|
||||
@classmethod
|
||||
def _register_website_track(cls, response):
|
||||
if getattr(response, 'status_code', 0) != 200:
|
||||
if getattr(response, 'status_code', 0) != 200 or request.httprequest.headers.get('X-Disable-Tracking') == '1':
|
||||
return False
|
||||
|
||||
template = False
|
||||
|
||||
Reference in New Issue
Block a user