Don't fire pixels or fetch trackers on requested ads.

This commit is contained in:
Brian Simpson
2014-09-01 23:43:13 -04:00
parent 5243f25f4a
commit 774c28ed7b
2 changed files with 5 additions and 1 deletions

View File

@@ -244,6 +244,8 @@ class ListingWithPromos(SubredditListingController):
skip=False)
res.parent_name = "promoted"
if res.things:
# update the css class so analytics.js can avoid firing pixels etc.
res.things[0].rowstyle_cls += " requested"
return res
def make_single_ad(self):

View File

@@ -5,7 +5,9 @@ r.analytics = {
init: function() {
// these guys are relying on the custom 'onshow' from jquery.reddit.js
$(document).delegate(
'.organic-listing .promotedlink.promoted, .comments-page .promotedlink.promoted, .linklisting .promotedlink.promoted',
'.organic-listing .promotedlink.promoted:not(".requested"), ' +
'.comments-page .promotedlink.promoted, ' +
'.linklisting .promotedlink.promoted:not(".requested")',
'onshow',
_.bind(function(ev) {
this.fetchTrackersOrFirePixel(ev.target)