-
-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Google Analytics & Class Hide #2
Conversation
fahmi182
commented
Jan 2, 2014
- Google universal analytics
- Class Hide to change style=display:none
Added Google Universal Analytics
For Google Analytics we should not just adding the script link but the whole script so user just need to add their Google Analytics ID, please use heredoc syntax. |
Okay updated, did you mean like that? added script in function? |
Please see how I add the Disqus script on functions.php, the GA script should like this: <script type="text/javascript">
// <![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{$analytics}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
// ]]>
</script> |
:) its older GA script, i use new - Google Universal Analytics, okey i'll update with older script :) |
Using newest script is okay but we should not put the script directly to the template but we just need to call a function to print it :) |
Here u go fahmi182@17f813f |
Look good to me but please move the script to the bottom, before the body tag. |
Okay - move to bottom :) |
Last changes before I merged this, please don't use |
Updated :) |
Add Google Analytics & Class Hide by @fahmi182
Does this mean, there is by default google analytics ON? Does this not invade privacy if someone does not wish to be tracked? |
Hi, this is an old issue so not relevant anymore. The default is off. |