I want to put analytics code to my website but in my cpanel, I have only 3 editable files, index.php , config.php and php.ini now kindly let me know where I have to put google analytics code? no one of these three has <\head> tag
You need to locate the template files, usually in the /templates folder It should be enough to edit the header.tpl file If you want to track the Admin visits, repeat for the /admin folder You will then need to apply the correct code or use the {literal} tag
You can download a file(sript provided while google analytic sign up ) to desktop and upload it directly to file maneger . Its the easiest method to add google Analytics and Webmaster tools .
You can put the tracking code in your index file. Its something like this: <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try{ var pageTracker = _gat._getTracker("UA-xxxxxx-x"); pageTracker._trackPageview(); } catch(err) {} </script> Change the code UA-XXXXXX to your own UA number. Regards
I have copied this code, but not getting how to paste it and where to paste it, kindly tell me the specific location to paste it. when I copied this code, I got the instruction to paste it before closing </head> tag. But I am unable to find this code in all files, index.php. config.php and php.ini I think I have to customize some file and put this <head></head> manually, but what would be exact code for it?
You'd better paste this code before </body> tag. And if you don't use templates, then you have to paste this code on every page of your site.
Now do not need to copy the HTML code any more,just put your GA code into the right place in your settings<Google Analytics Web Property ID.
still use analytics when google tag manager support analytics try to use tag manager and insert analytics code in tag manager.