summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/_inc/lib/tracks/class.tracks-client.php')
-rw-r--r--plugins/jetpack/_inc/lib/tracks/class.tracks-client.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/jetpack/_inc/lib/tracks/class.tracks-client.php b/plugins/jetpack/_inc/lib/tracks/class.tracks-client.php
index 97c4a3a4..90d5b171 100644
--- a/plugins/jetpack/_inc/lib/tracks/class.tracks-client.php
+++ b/plugins/jetpack/_inc/lib/tracks/class.tracks-client.php
@@ -157,7 +157,10 @@ class Jetpack_Tracks_Client {
$anon_id = 'jetpack:' . base64_encode( $binary );
- if ( ! headers_sent() ) {
+ if ( ! headers_sent()
+ && ! ( defined( 'REST_REQUEST' ) && REST_REQUEST )
+ && ! ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST )
+ ) {
setcookie( 'tk_ai', $anon_id );
}
}