mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Track whether a subscription is the user's first in breadcrumbs.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
)
|
||||
)
|
||||
},
|
||||
|
||||
@@ -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})
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user