Skip to content

Commit

Permalink
Screenview Event: Add beta participation field
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lee committed Oct 7, 2016
1 parent a91e867 commit b288e1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions r2/r2/lib/template_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def js_config(extra_config=None):
else:
expando_preference = "do_not_expand"

pref_beta = c.user.pref_beta
nsfw_media_acknowledged = logged and c.user.nsfw_media_acknowledged

if isinstance(c.site, Subreddit) and not c.default_sr:
Expand Down Expand Up @@ -271,6 +272,7 @@ def js_config(extra_config=None):
"listing_over_18": listing_over_18,
"expando_preference": expando_preference,
"pref_no_profanity": pref_no_profanity,
"pref_beta": pref_beta,
"nsfw_media_acknowledged": nsfw_media_acknowledged,
"new_window": logged and bool(c.user.pref_newwindow),
"mweb_blacklist_expressions": g.live_config['mweb_blacklist_expressions'],
Expand Down
2 changes: 2 additions & 0 deletions r2/r2/public/static/js/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ r.analytics = {
sr_name: r.config.post_site || null,
user_id: null,
user_name: null,
user_in_beta: r.config.pref_beta,
};

if (r.config.user_id) {
Expand Down Expand Up @@ -365,6 +366,7 @@ r.analytics = {
'dnt',
'referrer_domain',
'referrer_url',
'user_in_beta',
]);

if (r.config.event_target) {
Expand Down

0 comments on commit b288e1a

Please sign in to comment.