{"_id":"59b7d03c48ee6b0026e7945f","project":"5540ce1b31827a0d007ab1cc","version":{"_id":"5540ce1c31827a0d007ab1cf","project":"5540ce1b31827a0d007ab1cc","__v":31,"createdAt":"2015-04-29T12:27:08.390Z","releaseDate":"2015-04-29T12:27:08.390Z","categories":["5540ce1c31827a0d007ab1d0","5540d91bbb9e762d00f594ad","5540e5f131827a0d007ab212","5540e5febb9e762d00f594d3","5540e61331827a0d007ab213","5540e6195cf9682100d61afa","5540e62631827a0d007ab214","5540e63031827a0d007ab215","5540e63531827a0d007ab216","5540e63e5cf9682100d61afc","5540e6445cf9682100d61afd","5540e64a5cf9682100d61afe","55a4ff5b2e70c0250038050f","55acb28318eefd0d0071d504","55ae1abe8576b92300291c80","55ae453ef302af23000ac109","55af586d555b900d0036d296","55af91dac8a85321007a53c3","55b9fee204775a2f00628071","55b9ff0e04775a2f00628072","55b9ff4604775a2f00628073","55b9ff5fd72d1e1900276a38","55b9ff7f04775a2f00628074","55b9ff90eb08801900f833e5","55b9ffa5d72d1e1900276a39","55b9ffca04775a2f00628075","55b9fffdd72d1e1900276a3a","56bc2f033ee9e70d008b46af","56c2f6efbbf9ec2d00e0fe4f","57595bbb18760817001e8bbe","57d8d9793916800e003dde53"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"55a4ff5b2e70c0250038050f","pages":["55a4ff7d750a9a23005332af","55a4ff8b750a9a23005332b1","55a4ff9b750a9a23005332b3","55a60bfcaaf9cf1900114efb","55a6184880c8a30d00b32526","55a61ba780c8a30d00b32532","55a61c97aaf9cf1900114f40","55a61ea9aaf9cf1900114f48","55a6206580c8a30d00b32544","55a64277aaf9cf1900114fc2","55a694d1aaf9cf1900115102","55a6a23eaaf9cf19001151e2","55a6a9b389c9da1900e2a41d","55a6aba45f88a70d0065b255","55a90687c8bd450d000dd157","55af84f3aa902f1700300daa","55afa3e3902fd51700f5f858","55b0cc5cb3171b3700b153fa","56015bdc3aa0520d00da0ced","5603fe3490ee490d004404c2","5633dd18d28a340d004004f5","56448c697a8cb50d00a3ea3f","56d7a2ec5208281500a2506c","56d859b8b159f10b00304577","56d9822add90610b002708a1","56ef44c6e8d6fa17006f244f"],"version":"5540ce1c31827a0d007ab1cf","project":"5540ce1b31827a0d007ab1cc","__v":26,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-14T12:23:55.603Z","from_sync":false,"order":2,"slug":"features","title":"Features"},"user":"5540e0f5bb9e762d00f594c0","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-12T12:17:00.845Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":43,"body":"[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Enterprise feature\",\n  \"body\": \"Audit of push notifications delivery\"\n}\n[/block]\nAs soon as the Push Tracking functionality is enabled, each notification that you send for specific devices returns the unique tracking codes in the response:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"status_code\\\": 200,\\n  \\\"status_message\\\": \\\"OK\\\",\\n  \\\"response\\\": {\\n    \\\"Messages\\\": [\\\"CODE_NOT_AVAILABLE\\\"],\\n    \\\"TrackingCodes\\\": [\\\"TRACKING_CODE_1\\\"]\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nLater you may use the getTrackingLog API method in order to get the tracking logs of notifications: \nMethod `https://cp.pushwoosh.com/json/1.3/getTrackingLog`\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"request\\\": {\\n        \\\"auth\\\": \\\"API TOKEN\\\",\\n        \\\"date\\\": \\\"2017-01-02\\\" //[optional] date for which tracking log is required\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nResponse:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"status_code\\\": 200\\n    \\\"status_message\\\": \\\"OK\\\"\\n    \\\"response\\\": {\\n        \\\"request_id\\\": \\\"2702dd59b826e4a23b2f1af24de53108\\\" //request_id for getResults method\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThen use the `/getResults` method: `https://cp.pushwoosh.com/json/1.3/getResults`\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"request\\\": {\\n                \\\"auth\\\": \\\"API_ACCESS_TOKEN\\\",\\n                \\\"request_id\\\": \\\"2702dd59b826e4a23b2f1af24de53108\\\"\\n               }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nIn the results you will get the tracking log link: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"status_code\\\":200,\\n    \\\"status_message\\\":\\\"OK\\\",\\n    \\\"response\\\":{\\n        \\\"fileName\\\":\\\"http://static.pushwoosh.com/tracking_log_link.zip\\\" // direct link to zip file\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nIn the ZIP file you will find the CSV list (example below):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"//timestamp;tracking_code;target_id;hwid;status;description\\n2011-01-01T15:03:01.012345;T-8C4A-B1F3567F-80CDFDF3;USER_111;HWID_111;created;\\n2011-01-01T15:03:01.012345;T-8C4A-B1F3567F-80CDFDF3;USER_111;HWID_111;sent;\\n2011-01-01T15:03:01.012345;T-8C4A-B1F3567F-80CDFDF3;USER_111;HWID_111;delivered;\",\n      \"language\": \"text\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\nWhere:\n**timestamp** - time of the specified event\n**tracking_code** - tracking code generated for a given message\n**target_id** - device identifier (hwid/pushtoken) that was used for device specifying\n**hwid** - hardware id\n**status** - notification status: created, sent, delivered (notification gateway reported that notification was passed for the further delivery), failed (sending was unsuccessful)\n**description** - additional info","excerpt":"","slug":"push-notifications-tracking","type":"basic","title":"Push notifications tracking"}

Push notifications tracking


[block:callout] { "type": "success", "title": "Enterprise feature", "body": "Audit of push notifications delivery" } [/block] As soon as the Push Tracking functionality is enabled, each notification that you send for specific devices returns the unique tracking codes in the response: [block:code] { "codes": [ { "code": "{\n \"status_code\": 200,\n \"status_message\": \"OK\",\n \"response\": {\n \"Messages\": [\"CODE_NOT_AVAILABLE\"],\n \"TrackingCodes\": [\"TRACKING_CODE_1\"]\n }\n}", "language": "json" } ] } [/block] Later you may use the getTrackingLog API method in order to get the tracking logs of notifications: Method `https://cp.pushwoosh.com/json/1.3/getTrackingLog` [block:code] { "codes": [ { "code": "{\n \"request\": {\n \"auth\": \"API TOKEN\",\n \"date\": \"2017-01-02\" //[optional] date for which tracking log is required\n }\n}", "language": "json" } ] } [/block] Response: [block:code] { "codes": [ { "code": "{\n \"status_code\": 200\n \"status_message\": \"OK\"\n \"response\": {\n \"request_id\": \"2702dd59b826e4a23b2f1af24de53108\" //request_id for getResults method\n }\n}", "language": "json" } ] } [/block] Then use the `/getResults` method: `https://cp.pushwoosh.com/json/1.3/getResults` [block:code] { "codes": [ { "code": "{\n \"request\": {\n \"auth\": \"API_ACCESS_TOKEN\",\n \"request_id\": \"2702dd59b826e4a23b2f1af24de53108\"\n }\n}", "language": "json" } ] } [/block] In the results you will get the tracking log link: [block:code] { "codes": [ { "code": "{\n \"status_code\":200,\n \"status_message\":\"OK\",\n \"response\":{\n \"fileName\":\"http://static.pushwoosh.com/tracking_log_link.zip\" // direct link to zip file\n }\n}", "language": "json" } ] } [/block] In the ZIP file you will find the CSV list (example below): [block:code] { "codes": [ { "code": "//timestamp;tracking_code;target_id;hwid;status;description\n2011-01-01T15:03:01.012345;T-8C4A-B1F3567F-80CDFDF3;USER_111;HWID_111;created;\n2011-01-01T15:03:01.012345;T-8C4A-B1F3567F-80CDFDF3;USER_111;HWID_111;sent;\n2011-01-01T15:03:01.012345;T-8C4A-B1F3567F-80CDFDF3;USER_111;HWID_111;delivered;", "language": "text", "name": null } ] } [/block] Where: **timestamp** - time of the specified event **tracking_code** - tracking code generated for a given message **target_id** - device identifier (hwid/pushtoken) that was used for device specifying **hwid** - hardware id **status** - notification status: created, sent, delivered (notification gateway reported that notification was passed for the further delivery), failed (sending was unsuccessful) **description** - additional info