To accurate the stats of website, we are going to create Google analytics shortcode.Which will not be served to logged users i.e, admin, editor, contributor and anyone who’s viewing the dashboard.
We all know how to create and use shortcodes. it all starts by creating simple php function and then adding function to shortcode inside functions.php.
This tutorial will teach you how to fetch a current page url from a php page. you can use this function to dynamically highlight the menu item etc,..