Tracking without JavaScript

Our standard JavaScript implementation is the recommended means of tracking, but it's also possible to send data from your site's server side. This page demonstrates how to format HTTP requests to send visitor data in such cases.

The request

To send visitor data, make an HTTP GET request to http://srv.pixel.parsely.com/plogger/. The request headers should contain a User-Agent string specifying the user device (browser, version, etc.) initiating the action.

Path Arguments

idsite your Parse.ly API key
date ISO 8601 encoded event datetime string
ip_address IP address of the visitor
url URL of the page being viewed
urlref referring URL
screen client device resolution: (total width)x(total height)|(available width)x(available height)|(pixel depth)
action event type (pageview, heartbeat, videostart, or vheartbeat)
data user identifier (see below)
metadata JSON object containing Parse.ly metadata values (required for videostart and vheartbeat only)

Optional Parameters

title Page title

User Identifier

In order to tie multiple requests to a single user or device, provide a parsely_site_uuid field in the data JSON object:

&data={"parsely_site_uuid": "2706838D-A52F-40D8-BCD2-B343045AC2EE"}

Although the user ID specified above is a UUID-4, any identifier is fine as long as it's unique across all users of your site and does not contain any personally identifiable information. For example, if you wish to track logged-in users, you should not provide a user's e-mail address as the UUID; instead, send it as a salted hash. If possible, you should persist identifiers across sessions in order to track new vs. returning visitors.

If you've paid for our audience segmentation feature, you should pass the relevant values in the data object as well:

&data={"parsely_site_uuid": "2706838D-A52F-40D8-BCD2-B343045AC2EE", "subscription_plan": "premium"}

Example

An example of a complete pageview request to the insertion API might be::

GET /plogger/?rand=48919820492&idsite=yoursite.com&date=2013-11-05T00%3A23%3A12.142-0500&ip_address=243.123.22.1&data=%7B%22parsely_site_uuid%22%3A%20%222706838D-A52F-40D8-BCD2-B343045AC2EE%22%7D&url=http%3A%2F%2Fyoursite.com%2Fsome-article-1234&urlref=http%3A%2F%2Fyoursite.com%2F&screen=1440x900%7C1436x878%7C24&title=Article+title+1234&action=pageview
Host: srv.pixel.parsely.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36

Or, with the query string elements broken out and the URL unencoded:

?rand=48919820492
&idsite=yoursite.com
&date=2013-11-05T00:23:12.142-0500
&ip_address=243.123.22.1
&data={"parsely_site_uuid": "2706838D-A52F-40D8-BCD2-B343045AC2EE"}
&url=http://yoursite.com/some-article-1234
&urlref=http://yoursite.com/
&screen=1440x900|1436x878|24
&title=Article title 1234
&action=pageview

Videostarts are similar, but they require the additional metadata parameter:

?rand=1518491004458
&idsite=blog.parsely.com
&date=2013-11-05T00:23:12.142-0500
&ip_address=243.123.22.1
&data={"parsely_site_uuid":"ca067e10-a182-4335-ac94-b203a2ab6456"}
&url=https://blog.parse.ly/post/77/ars-technica-and-the-art-of-the-dash-api/
&urlref=https://blog.parse.ly/
&screen=1280x800|1280x709|24
&action=videostart
&metadata={"duration":990053,"image_url":"https://embedwistia-a.akamaihd.net/deliveries/541f551d550e0103542b9269f7dc8a530869f0c3.jpg","pub_date_tmsp":1453319677,"title":"How Ars Technica Uses Parse.ly","video_platform":"wistia","section":"blog video","author":"Parse.ly","tags":["Parse.ly","Blog","Videos","Digital Content Analytics"],"link":"q1w17ngt2c"}

Consult our video documentation for information on the required fields in the metadata object.

Tracking engaged time

Parse.ly's standard JavaScript tracker collects engagement data by sending heartbeat events at regular intervals so long as a reader is interacting with a page (or, in the case of vheartbeat events, watching a video). For a detailed explanation of how we define engagement and trigger heartbeat events, consult our documentation or have a look at our open-source implementation.

It's also possible to track engagement server-side. To do so, monitor activity on the client and send heartbeat or vheartbeat requests at regular intervals of between one and fifteen seconds. These requests must include an inc parameter denoting the number of seconds within the interval during which the visitor was engaged. The inc value can't be less than 1 or greater than 15; otherwise, it will be ignored.

For example, you might configure your application to send heartbeat events every ten seconds. If a visitor were engaged for just five of those seconds, the request would look something like this:

?rand=48919820492
&idsite=yoursite.com
&date=2013-11-05T00:23:12.142-0500
&ip_address=243.123.22.1
&data={"parsely_site_uuid": "2706838D-A52F-40D8-BCD2-B343045AC2EE"}
&url=http://yoursite.com/some-article-1234
&urlref=http://yoursite.com/
&screen=1440x900|1436x878|24
&title=Article title 1234
&action=heartbeat
&inc=5

vheartbeat requests are similar but, like videostart, also require a metadata parameter:

?rand=1518491004458
&idsite=blog.parsely.com
&date=2013-11-05T00:23:12.142-0500
&ip_address=243.123.22.1
&data={"parsely_site_uuid":"ca067e10-a182-4335-ac94-b203a2ab6456"}
&url=https://blog.parse.ly/post/77/ars-technica-and-the-art-of-the-dash-api/
&urlref=https://blog.parse.ly/
&screen=1280x800|1280x709|24
&action=vheartbeat
&inc=5
&metadata={"duration":990053,"image_url":"https://embedwistia-a.akamaihd.net/deliveries/541f551d550e0103542b9269f7dc8a530869f0c3.jpg","pub_date_tmsp":1453319677,"title":"How Ars Technica Uses Parse.ly","video_platform":"wistia","section":"blog video","author":"Parse.ly","tags":["Parse.ly","Blog","Videos","Digital Content Analytics"],"link":"q1w17ngt2c"}
Thanks for your question, we will get back to you shortly!
Do you have an urgent support question?