Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Tracking StreamHub Referral Traffic

sallymitchell edited this page · 12 revisions
Clone this wiki locally


StreamHub referral traffic from social networks and emails may be tracked by inspecting the query string parameters in the URLs of your pages and implementing code on your page to track this through your analytics provider. Livefyre appends a referral link to the URL when a comment is posted or shared to a social network, and for permalinks included in Livefyre emails.

Implementation Example

If the traffic was from a StreamHub-powered notification, there will be a 'hubRefSrc' query string parameter with a value of 'email', 'facebook', 'twitter', 'linkedin', or 'permalink'. The 'hubRefSrc' parameter name can be configured at the network level by Livefyre.

In order to integrate with an analytics platform, your page should look for the hubRefSrc on load and record the traffic if it is present. Here is an example of the implementation code:

(function () {
    var qs =,
        param = 'hubRefSrc',
        valueRegex = new RegExp(param+'=([^&]+)'),
        match = qs.match(valueRegex),
    if (match) {
        // StreamHub generated traffic!
        referrer = match[1];
        console.log('StreamHub referred via', referrer);
    } else {
        // StreamHub did not refer this traffic
Something went wrong with that request. Please try again.