Mobile app tracking

Instructions for custom implementation of tracking the mobile app traffic

This is usually the last stage of the implementation so, at this moment, the Insights tracking script probably already sends the data from the website. You can check these events in the Network tab, filtered by this regular expression string:



The expected response for all GET requests is "204 No Content".

All events are sent to the following endpoints:

The legacy domain is and it's also functional:

As you can see, there are two types of requests sent by the Insights tracking script:

  1. p-request
  2. a-request 

Here is a detailed explanation of each.

1. Page View and Article Read

The Page View request should be fired immediately after the Insights script has been triggered. 

On a regular website (JavaScript) implementation, the smartocto Insights tracker waits for 10 seconds after the page has been loaded and then fires the Article Read request, if the visitor is still on the page.

1.1. Page View request

This request is sent in the form of a GET request for the image on our servers. The endpoint URL is:

Here is the list of all parameters that can be sent in a single Page View request (p-request):

  a - comma-separated list of authors
b - referral URL
c - article title
d - article URL
e - comma-separated list of sections (categories)
f - domain ID
g - article publish date in extended ISO 8601 format (2020-02-20T12:34:56+00:00)

h - comma-separated list of tags [optional]
i - comments [deprecated]
j - access level: "free" or "paid" [optional]
k - article type [optional]
l - image URL [deprecated]
m - reader type: "anonymous", "registered" or "subscribed" [optional]
n - page type: "article" (default value) or "landing" [optional]

pid - unique article ID (usually the ID from the internal CMS)

u - session cookie identifier
ul - lifetime cookie identifier
x - request identifier (random number)
t - request type identifier (t=0)

ver - version indicator, automatically assigned by the tracker
err - error code, automatically assigned

ch - "Android" or "iOS"
os_ver - only from mobile SDK requests (system version)
manuf - only from mobile SDK requests (device manufacturer)

On regular website implementations, we can see some legacy parameters with empty values that are automatically added by the tracker. They are not sent through the mobile SDKs, AMP and FIA requests and can be completely omitted in custom implementations. 

Optional parameters can also be omitted, but please consult our Support Team for details and special cases (e.g. Paywall setup).

Please note that mobile SDK and custom-built app requests don't have to contain all parameters. For any custom implementation, here is the minimum set of parameters to make a valid p-request:

  d - URL
f - domain ID
pid - unique article ID (can be canonical URL or the ID from internal CMS)
u - session cookie identifier
ul - lifetime cookie identifier
x - request identifier (random number)
t - request type identifier (t=0)
ch - AMP, Android or iOS

This is because for a given article the system normally receives standard requests from the website and those requests contain all meta-data.

Mobile app or custom-built requests can have a reduced number of parameters because the system will process the data and attribute the statistics to the corresponding article by matching the URL (d), domain ID (f), and unique article ID (pid).

However, if for any reason mobile app content can't be found on the website (e.g. specially promoted or premium content), additional parameters must be set (title, authors, pubdate, sections, etc) because the system will not have any other source to match. Please refer to the examples section at the bottom of this page.

Cookie values

There are two cookies added by the Insights tracker on standard website implementations:

 u - a session cookie (identifier) that lasts for 30 minutes.
ul - a lifetime cookie that expires two years after the last visit.

In the original JavaScript tracker code, the session cookie is generated like this:

_ain.generateCID = function() {
return new Date().getTime() + "." + Math.random() * 1e9;

So, the lifetime cookie can be set to two years ahead with this formula:

ul = new Date().getTime() + 1000*60*60*24*365*2 + "." + Math.random() * 1e9;

On websites running the Insights script, these values can be found in the browser cookies with their corresponding values:

_ain_cid =  u = 1701861234000.128094919.29444183
_ain_uid = ul = 1765019634000.319545495.82194793

If the value of the ul format doesn't correspond with the abovementioned, the system will parse it with the timestamp of the received request.

x parameter

The x-parameter is a random number whose main purpose is to prevent caching, but all p- and a-requests should have the same x value during a single article visit from a single visitor.

JavaScript example:

x = Math.random(); // 0.10776367005369303

It is possible to only track pageviews which significantly simplifies the development process, as only one p-request should be sent with each visit.

1.2. Article Read request

This request is sent to the same address as the Page View request with the same parameters and one important difference (t=1):

  d - URL
f - domain ID
pid - unique article ID (can be canonical URL or the ID from internal CMS)
u - session cookie identifier
ul - lifetime cookie identifier
x - request identifier (random number)
t - request type identifier (t=1)
ch - AMP, Android or iOS

word count

It is possible to send some additional and optional parameters.

For example it's possible to send the word count, as this value can't be automatically detected, as the JavaScript tracker does on a regular setup on the website.

wc - the number of words in the article, including the title and the description 

2. Attention time tracking

After the page is loaded, the code starts tracking active attention time. Active time means there is a person behind the screen whom we detect the help of tab focus and page activity (e.g. mouse movements, keyboard clicks, scrolling, etc.)

Attention Time request

The tracking is done by sending one Attention Time request every 5 seconds to smartocto Insights’ servers via GET parameters. The address is:

Here is the list of all parameters that can be sent in a single Attention Time request (a-request):

  d - URL
f - domain ID
pid - article ID
b - referrer
ch - (values: AMP, Android or iOS)
u - session cookie
ul - lifetime cookie
at - current attention time, accumulated
ar - a difference in seconds between the two consecutive requests
sp - scroll position, considering only the article's true content
ts - current timestamp
seq - sequence number, the request counter for the current page visit
x - request identifier

Please note that matching parameters from a-request should have the same value as a corresponding p-request parameter for a given article in a single page load.


  f - domain ID
d - URL
b - referrer
pid - article ID
ch - channel identifier ("Android" or "iOS")
x - request identifier (random number)
u - session cookie
ul - lifetime cookie

Scroll Position calculation

Here's an example of how the scroll position could be calculated (the result should be in percentages, 0-100):

sp = 100 * (viewportHeight + scrollTop) / scrollHeight


Request examples

Here are a few example requests from a single session (on a single article):

Android requests

The following parameters were sent through the tracker:


Page View - fires immediately after opening an article (0 seconds):


Article Read - fires if the user reads an article for 10 seconds:


Attention Time - fires every 5 seconds when the user reads an article:





iOS requests






If you have any additional questions or concerns feel free to contact our Support Team.