Track whether a subscription is the user's first in breadcrumbs.

This commit is contained in:
Max Goodman
2014-04-09 20:11:52 -07:00
parent d4dce83ee7
commit dcff90aa0c
3 changed files with 5 additions and 3 deletions

View File

@@ -165,6 +165,7 @@ def js_config(extra_config=None):
"new_window": bool(c.user.pref_newwindow),
"vote_hash": c.vote_hash,
"gold": gold,
"has_subscribed": logged and c.user.has_subscribed,
}
if extra_config:

View File

@@ -131,7 +131,7 @@ r.analytics = {
$el.data('trackerFired', true)
},
fireUITrackingPixel: function(action, srname) {
fireUITrackingPixel: function(action, srname, extraParams) {
var pixel = new Image()
pixel.src = r.config.uitracker_url + '?' + $.param(
_.extend(
@@ -140,7 +140,8 @@ r.analytics = {
'sr': srname,
'r': Math.round(Math.random() * 2147483647) // cachebuster
},
r.analytics.breadcrumbs.toParams()
r.analytics.breadcrumbs.toParams(),
extraParams
)
)
},

View File

@@ -299,7 +299,7 @@ function subscribe(reddit_name) {
}
$.things(reddit_name).find(".entry").addClass("likes");
$.request("subscribe", {sr: reddit_name, action: "sub"});
r.analytics.fireUITrackingPixel("sub", reddit_name)
r.analytics.fireUITrackingPixel("sub", reddit_name, {"has_subd": r.config.has_subscribed})
}
};
};