Skip to content

Server-side tracking without JavaScript

We have a few recommended integration options, 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://p1.parsely.com/plogger/.

Headers

KeyRequiredDescription
User-AgentYesuser agent of device that made the request
X-Parsely-IPNoIP address to be associated with request (for example, proxying requests from a browser through a server)

Parameters

KeyRequiredDescription
randYescurrent timestamp in milliseconds
idsiteYesyour Parse.ly Site ID (apikey)
dateNoISO 8601 encoded event datetime string
urlYesURL of the page being viewed
urlrefYesreferring URL
screenNoclient device resolution: (total width)x(total height)|(available width)x(available height)|(pixel depth)
actionYesevent type (pageview, heartbeat, videostart, vheartbeat, or conversion)
dataOnly for advanced use – see belowextra data
metadataOnly for videoJSON object containing Parse.ly metadata values (required for videostart and vheartbeat only). Note that this object should also contain a link key, with a value that stays consistent across platforms (e.g. web and mobile app).
uYesPseudonymous UUID of device
plidYesPageload id, a unique id (random integer) used for correlating events across a tracker instance. All events sent during a tracker instance should have the same Pageload id
pvidYesPageview ID, a unique id (random integer) used for correlating events across a pageview. Should be generated prior to sending a pageview. The pageview and all events sent before the next pageview should have a consistent Pageview ID.
sidYesSession ID, an incrementing count of sessions for this user/device
stsNoSession Timestamp, UNIX timestamp of the session creation (milliseconds since epoch)
surlNoSession Initial URL, first pageview of the session
srefNoSession Initial Referrer, referrer of the first pageview of the session
sltsYesLast Session Timestamp, UNIX timestamp of the last session the user had (milliseconds since epoch). 0 if this is the user’s first session
incOnly for heartbeats and vheartbeatsEngaged Time incremental value (seconds)
ttOnly for heartbeats and vheartbeatsEngaged Time total time (milliseconds)
vsidOnly for video related actionsVideostart ID, a unique id (random integer) used for correlating events across a video play. Should be generated prior to sending a videostart. The videostart and all vheartbeats tied to the video should have a consistent Videostart ID.

Data Parameter

The “data” key in the parameters above can be used to pass details about an event with action=conversion.

_conversion_typeone of link_click, lead_capture, subscription, purchase, newsletter_signup
_conversion_labelArbitrary string to label conversion

User Identifier

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:

data={"subscription_plan": "premium"}

Example

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

GET /plogger/?rand=48919820492&idsite=yoursite.com&plid=42677574&pvid=30866483&date=2013-11-05T00%3A23%3A12.142-0500&&data=%7B%7D&u=12047d3f-0280-4bed-aedb-eaf9177124e5&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&slts=0
Host: p1.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
&plid=42677574
&pvid=30866483
&date=2013-11-05T00:23:12.142-0500
&data={}
&u=12047d3f-0280-4bed-aedb-eaf9177124e5
&url=http://yoursite.com/some-article-1234
&urlref=http://yoursite.com/
&screen=1440x900|1436x878|24
&action=pageview
&slts=0

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

?rand=1518491004458
&idsite=blog.parsely.com
&date=2013-11-05T00:23:12.142-0500
&u=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.

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, 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
&u=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
&slts=0

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
&u=2706838D-A52F-40D8-BCD2-B343045AC2EE
&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"}
&slts=0

Last updated: September 14, 2023