decouple ad and analytics javascript