Coder Social home page Coder Social logo

yogoo / analytics Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 344 KB

Analytics is a utility tool for MODX Revolution that will insert the tracking code for Google Universal Analytics (analytics.js or ga.js). By default it will ignore traffic from users logged into the manager. Crispy details at:

Home Page: http://rtfm.modx.com/extras/revo/analytics

PHP 100.00%

analytics's People

Contributors

yogoo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

qpc-database

analytics's Issues

New MODX version

Is it possible to update the package to revo version 2.4.x? I can't find it in the Package Manager as it is right now :(

Invalid JS in ga option

Closing curly bracket should be regular bracket in
analytics.class.php(179):

if ($this->config['enhancedLinkAttribution']) $UAtracker.= "ga('require','linkid','linkid.js'};";

should be
if ($this->config['enhancedLinkAttribution']) $UAtracker.= "ga('require','linkid','linkid.js');";

Respect Do not track HTTP headers

With new EU cookie laws now in effect, it would be a useful feature if the analytics function respected the Users 'Do Not Track' browser settings

A function to do that, taken from http://robert-lerner.com/do-not-track-headers-in-php.php

function do_not_track() {
  if (isset($_SERVER['HTTP_DNT'])) {
    if ($_SERVER['HTTP_DNT']==1) {
      RETURN TRUE;
    }
  } elseif (function_exists('getallheaders')) {
    foreach (getallheaders() as $k => $v) {
      if (strtolower($k)==="dnt" && $v==1) {
        RETURN TRUE;
      }
    }
  }
  RETURN FALSE;
}

Looking at the Analytics.php code, you already have the ability to not track a manager user. Could this be extended for the DNT header?

It may be nice to make the DNT feature an optional parameter in the snippet call.

Hide Settings Tab in Dashboard Widget

First off, great Add-On! I love the dashboard widget. I hope this is the right place to put a feature request (as it's not an "issue"). Would like for a way to hide the Settings tab in the dashboard widget so clients cannot view data for other accounts attached to the Google ID (on the dashboard widget: Settings > Site profile:). I noticed "Ability to hide tabs" in changelog.txt but couldn't figure out how. Perhaps just a new System setting to show or hide it? Again, awesome work! Thanks for your consideration and... viva la MODX!

Unable to get stats from analytics

Hi Jérome,

I was trying to implement Analytics on my modx revo environment Rev 2.2.7pl site, and I can't get it to send stats to google (watching site analytics in real time mode)

I provide you under with the snippet call and my original ga code :

[[!Analytics? &setAccount=UA-35841363-1 &setDomainName=amazili-communication.com &debug=1]]

<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-35841363-1']); _gaq.push(['_setDomainName', 'amazili-communication.com']); _gaq.push(['_setAllowLinker', true]); _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'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>

the debug code is hereunder :

<script> var _gaq=_gaq||[]; var pluginUrl='//www.google-analytics.com/plugins/ga/inpage_linkid.js'; _gaq.push=[ ['_require', 'inpage_linkid', pluginUrl],['_setAccount','UA-35841363-1'], ['_trackPageview'], ['_setDomainName', 'amazili-communication.com'] ]; (function(d,t) {var g=d.createElement(t), s=d.getElementsByTagName(t)[0]; g.async=1; g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; s.parentNode.insertBefore(g,s)}(document,'script'));</script>

here are the current installed packages, all in the latest version :

Analytics
archivist
Articles
Big Brother
FormIt
getpage
getResourceField
getresources
Quip
sitemapFriend
taglister
Wayfinder

Any idea ?

Thanks

Philippe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.