Skip to content
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

Merged
merged 10 commits into from
Jan 2, 2014
Merged

Add Google Analytics & Class Hide #2

merged 10 commits into from
Jan 2, 2014

Conversation

fahmi182
Copy link
Contributor

@fahmi182 fahmi182 commented Jan 2, 2014

  • Google universal analytics
  • Class Hide to change style=display:none

@danpros
Copy link
Owner

danpros commented Jan 2, 2014

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.

@fahmi182
Copy link
Contributor Author

fahmi182 commented Jan 2, 2014

Okay updated, did you mean like that? added script in function?
Script use universal analytics - https://support.google.com/analytics/answer/2790010?hl=en

@danpros
Copy link
Owner

danpros commented Jan 2, 2014

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>

@fahmi182
Copy link
Contributor Author

fahmi182 commented Jan 2, 2014

:) its older GA script, i use new - Google Universal Analytics, okey i'll update with older script :)

@danpros
Copy link
Owner

danpros commented Jan 2, 2014

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 :)

@fahmi182
Copy link
Contributor Author

fahmi182 commented Jan 2, 2014

Here u go fahmi182@17f813f

@danpros
Copy link
Owner

danpros commented Jan 2, 2014

Look good to me but please move the script to the bottom, before the body tag.

@fahmi182
Copy link
Contributor Author

fahmi182 commented Jan 2, 2014

Okay - move to bottom :)
fahmi182@cf6cffd

@danpros
Copy link
Owner

danpros commented Jan 2, 2014

Last changes before I merged this, please don't use google.analytics.js on config.ini but more descriptive like google.analytics.id :)

@fahmi182
Copy link
Contributor Author

fahmi182 commented Jan 2, 2014

Updated :)

danpros added a commit that referenced this pull request Jan 2, 2014
Add Google Analytics & Class Hide by @fahmi182
@danpros danpros merged commit a952a3a into danpros:master Jan 2, 2014
danpros pushed a commit that referenced this pull request Jul 21, 2014
danpros pushed a commit that referenced this pull request Aug 6, 2014
@jsebean jsebean mentioned this pull request Nov 17, 2017
@amladloz amladloz mentioned this pull request Mar 11, 2021
danpros pushed a commit that referenced this pull request Feb 19, 2024
@vdbhb59
Copy link
Contributor

vdbhb59 commented Feb 20, 2024

Does this mean, there is by default google analytics ON? Does this not invade privacy if someone does not wish to be tracked?

@danpros
Copy link
Owner

danpros commented Feb 20, 2024

Hi, this is an old issue so not relevant anymore. The default is off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants