Api для отслеживания посылок.
Google recently announced an entirely new API for Google Ads app conversion tracking and remarketing. The primary drivers for developing this new API are to make app analytics and attribution simpler for advertisers and more reliable for Google Ads attribution partners .
From here on out, we"ll simply refer to the new API for app conversion tracking and remarketing as "the API".
Concepts
The API introduces several new concepts for those who are familiar with the legacy API.
App events
Where the legacy conversion tracking API is concerned with "conversion IDs" and "conversion labels," the API is concerned with "app events" in a generic sense. In the legacy API integration, the syntactic mapping between app events and Google Ads app conversion events is handled in the third-party analytics systems via their respective configuration panels. The legacy integration hence requires the generation of said "conversion IDs" and "conversion labels" in Google Ads followed by a mapping in the third-party system.
The API, however, allows consumers to forward app events by name , atomically, to Google Ads. With this, advertisers can begin tracking conversions externally without additional required setup in Google Ads.
Get push notifications from EasyPost every time a package scan occurs. Delivery confirmation within 15 minutes of the scan. Updates are standardized across carriers so they can be easily consumed and pushed into our dashboards.
Intelligent Delivery Estimates
EasyPost bolsters carrier-generated estimated delivery dates with proprietary tracking intelligence. Our time in transit algorithm provides a more accurate estimated delivery date based on historical data and real-time carrier feedback.
Branded Tracking Pages
Customizable pages that allow you to own the customer experience. Delivery data automatically updates based on our tracking data, ensuring customers are always receiving the most recent information.
Flexible Webhooks
Tracking data is available for you and your customers on any platform via our webhooks. Push delivery data to your site, notify customers of package movements via text, mobile apps or Facebook messenger, send automated emails when there is a tracking update and keep your WMS up-to-date with the progress of your packages.
This is default recommended client. Learn more at:
Using the Javascript client works well for most users where pasting a Javascript code in the page footer is not an issue.
Tracking API Clients
Sometimes you cannot use JavaScript to track data with Matomo. Whether you develop iOS apps, Android apps, Titanium apps, or apps written in PHP, Java, C#, C++, Python, etc. you can use a native client to track the data in Matomo.
Tracking API Reference
If you are not using Javascript, PHP, Java, Python, C#, C++, Python or Objective -C (for which clients are available), you can still directly call the Tracking Web API over HTTPS.
The following parameters can also be passed to the image URL:
- rec – (required) The parameter &rec=1 is required to force the request to be recorded
- idsite – (required) Defines the Website ID being tracked
- action_name – Defines the custom Page Title for this page view
- urlref
– The Referrer URL: must be set to the referrer URL used before landing on the page containing the Image tracker. For example, in PHP this value is accessible via
$_SERVER["HTTP_REFERER"] - idgoal – The request will trigger the given Goal
- revenue – Used with idgoal, defines the custom revenue for this conversion
- bots – Set &bots=1 to track all requests to the tracking image, including from bots and robots
- and more! – There are many more parameters you can set beyond the main ones above. See the .
Matomo Tracking API (Advanced users)
It is also possible to call the Matomo Tracking API using your favorite programming language.
Follow these instructions to get started with the PHP Tracking Web API client:
- (You may need to right click this link and select Save Page As)
- Upload the PiwikTracker.php file in the same path as your project files
Method 1: Advanced Image Tracker
The client is used to generate the tracking URL that is wrapped inside a HTML code.
Paste this code before the code in your pages.Page titles")) . "" alt="" />"; // Example 2: Triggers a Goal conversion for Website id = {$IDSITE} and Goal id = 2 // $customRevenue is optional and is set to the amount generated by the current transaction (in online shops for example) echo ""; ?>
The Advanced Image Tracker method is similar to using the standard Javascript Tracking code. However, some user settings are not detected (resolution, local time, plugins and cookie support).
Method 2: HTTP Request
You can also query the Matomo Tracker API remotely via HTTP. This is useful for environment where you can’t execute HTML nor Javascript.
Paste this code anywhere in your code where you wish to track a user interaction.
Copy the following code, then paste it onto every page you want to track.
Choose a Tracking method, then paste the code onto every page you want to track.
Начало работы
Сервис Post2Go предоставляет доступ к данным об отслеживании посылок с помощью API, реализованного протоколом JSON-RPC 2 . Сам протокол знать не обязательно, мы опишем его ниже.
Перед тем, как вы сможете получить доступ к API, вам необходимо зарегистрироваться и оставить заявку на подключение . Вам будет предоставлен доступ к интерфейсу управления подключенными приложениями , в котором вы сможете сгенерировать ключ для доступа к API.
Точка доступа к API
Все запросы к API делаеются к точке доступа, расположенной по адресу http://api..
Каждый запрос обязательно должен содержать следующие заголовки:
X-Authorization-Token: ВАШ_API_КЛЮЧ Content-Type: application/json
Тело запроса
Тело запроса всегда должно иметь указанный вид:
{ "jsonrpc ": "2.0" , "method ": "methodName" , "params ": { } , "id ": 1 }- Параметр jsonrpc обязателен и его значение всегда должно быть 2.0 ;
- Параметр method обязателен, в него должно быть записано название запрашиваемого метода;
- Параметр params обязателен, если у метода нет параметров - нужно передать пустой объект { } как в примере;
- Параметр id обязателен, он позволяет идентифицировать ответ API. Если вам это не нужно, то просто передавайте в нём любую строку или число.
Формат ответа
Ответ API в случае успеха выглядит следующим образом:
{ "jsonrpc ": "2.0" , "id ": 1 , "result ": }- В параметр id копируется значение id полученное в запросе;
- Параметр result передаётся всегда, но может содержать значения null , или { } . Его значение всегда зависит от метода.
Если параметр result отсутствует, значит произошла ошибка. Ответ в случае ошибки выглядит так:
{ "jsonrpc ": "2.0" , "error ": { "code ": 401 , "message ": } , "id ": null }- Параметр jsonrpc передаётся всегда и его значение всегда 2.0 ;
- В параметр id копируется значение id полученное в запросе, кроме случаев когда произошла глобальная ошибка;
- Параметр error всегда содержит объект ошибки с кодом и сообщением. Расшифровку возможных кодов смотрите ниже.
Внимание! Проверяйте тип ошибки по коду, а не по тексту. Текст может меняться со временем, либо зависеть от поступившенго запроса, а код является фиксированным.
Возможные ошибки
Не передан X-Authorization-Token в заголовках запроса:
{ "jsonrpc ": "2.0" , "error ":{ "code ": 401 , "message ": "X-Authorization-Token is required and must be a string" } , "id ": null }X-Authorization-Token передан, но является неверным:
{ "jsonrpc ": "2.0" , "error ":{ "code ": 401 , "message ": "Invalid or expired X-Authorization-Token" } , "id ": null }Синтаксическая ошибка при разборе запроса, передан неправильный JSON:
{ "jsonrpc ": "2.0" , "error ":{ "code ": -32700 , "message ": "Parse error" } , "id ": null }Передан неправильный запрос, например не указан один из обязательных параметров:
{ "jsonrpc ": "2.0" , "error ":{ "code ": -32600 , "message ": "Invalid request" } , "id ": null }Запрошенный метод не существует или не доступен:
{ "jsonrpc ": "2.0" , "error ":{ "code ": -32601 , "message ": "Requested method does not exist" } , "id ": null }Один из переданных параметров не соответствует требованиям:
{ "jsonrpc ": "2.0" , "error ":{ "code ": -32602 , "message ": "Invalid parameter" } , "id ": null }Произошла внутренняя ошибка сервера:
{ "jsonrpc ": "2.0" , "error ":{ "code ": -32603 , "message ": "Internal error" } , "id ": null }Запрошенный объект не найден:
{ "jsonrpc ": "2.0" , "error ":{ "code ": 404 , "message ": "Nothing found" } , "id ": null }Попытка получить информацию о треке до постановки на отслеживание:
{ "jsonrpc ": "2.0" , "error ":{ "code ": 403 , "message ": "Access denied. You should addTracking to access this operation." } , "id ": null }