The dev page on the HTTP API does not contain any information about how to add "time on page"/"heartbeat" information to pageviews. (Introduced by the ping=1 query param pull request )
It seems that currently it is possible to use, by issuing 2 requests with a modified cdt
:
{
"requests": [
"?cdt=2016-01-05+20:10:21&idsite=1&url=http://example.org&action_name=Test bulk log Pageview&rec=1&apiv=1",
"?cdt=2016-01-05+20:10:51&idsite=1&url=http://example.org&action_name=Test bulk log Pageview&rec=1&apiv=1&ping=1",
],
"token_auth": "33dc3f2536d3025974cccb4b4d2d98f4"
}
I think it would be nice to add an example like this, and in a future version perhaps also consider adding a timeonpage
type parameter so requests don't need to be doubled.
@diosmosis can you maybe document it?
If @mattab makes it a priority for me, I will get to it the next time I work on Piwik.
@diosmosis +1 this should take a few minutes only to document our new ping
parameter