wiley / madgex-lazy-ads

Deliver synchronous ads asynchronously, without modifying the ad code. Also, conditionally load ads for responsive websites using a media query or the ad container's dimensions.
MIT License
656 stars 42 forks source link

Best practises #1

Closed janniconl closed 10 years ago

janniconl commented 10 years ago

Hi mate, Interisting looking plugin. Any best practices in mind for imlementing with Google analytics scripts? Thx!

jameswragg commented 10 years ago

Hi Jan, Lazy Ads wasn't intended for use with GA although you could potentially lazy-load any script in the Lazy Ads wrapper, I'm not sure why you'd want to with analytics. The current GA script loads with the async attribute, so there'd be no performance benefit & if implementing GA I'd have thought you'd want analytics on your whole audience? Hope that answers your question!

jackappleby commented 10 years ago

Further to what James says about lazy-loading any script, I've had success with lazy-loading 'Feedback'* widgets into pages. I didn't want the Feedback tab to be loaded on small screens as it just didn't work well in a small-screen setting, so I set the load conditions to only load if the viewport was wide enough.

*Those tabs on the left or right-hand side of the page that are generated by a snippet of JavaScript.