placing analytics in default layout to avoid repetition  of code