A way to not count impressions on responsive hiding of ad blocks

Created on 23 May 2015, about 9 years ago
Updated 9 June 2023, about 1 year ago

I had the need to not display certain ads when browser dropped below a certain width. I could hide the blocks with the css of "display: none;" but then the impression was still being counted. So I updated the simpleads.cycle.js to check to see if the containing block had a display attribute value of 'none', and if so, then not call the impression callback. I'm posting a patch here in case this is useful to anyone - it may be a bit specific in nature for general use, but I'm happy to refactor if anyone has the need.

✨ Feature request
Status

Closed: won't fix

Version

2.0

Component

Code

Created by

πŸ‡ΏπŸ‡¦South Africa foxtrotcharlie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024