AamAadmiParty / india-standalone-drupal

A drupal based website that currently powers http://aamaadmiparty.org/, the "main" site. It is different from other AAP websites in drupal for primarily large scale email sending capabilities, among many other small things. (This website is a contender for merging with 'regional-domainsite-drupal' reposiroty when the latter is ready)
GNU General Public License v2.0
0 stars 1 forks source link

Changes in google analytics #146

Closed sumeetpareek closed 10 years ago

sumeetpareek commented 10 years ago

Based on the conversations in the comments below, I would update the task list here -

sumeetpareek commented 10 years ago

@ankurshrivastav just requested the GA embed to be changed to the below.. I have replaced the actual UA-code with CODE-HERE

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'CODE-HERE', 'aamaadmiparty.org');
  ga('send', 'pageview');

</script>

The below is what we are currently using

<script>var _gaq = _gaq || [];_gaq.push(["_setAccount", "CODE-HERE"]);_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>

From glancing over the Google Analytics blog - http://analytics.blogspot.in/ I could not find information about changing how GA embedding is done.

ankurshrivastav commented 10 years ago

The new GA scripts offers much richer analytics and therefore the need to change. The code of the new GA is very different from the old GA, so that needs to be changed.

We need to search for a module that supports "Universal Analytics" or figure out a way to put this Javascript tracking code in every header, instead of the existing GA script added by the Drupal module.

On Fri, Feb 21, 2014 at 12:14 PM, Sumeet Pareek notifications@github.comwrote:

@ankurshrivastav https://github.com/ankurshrivastav just requested the GA embed to be changed to the below.. I have replaced the actual UA-code with CODE-HERE

The below is what we are currently using

From glancing over the Google Analytics blog - http://analytics.blogspot.in/ I could not find information about changing how GA embedding is done.

Reply to this email directly or view it on GitHubhttps://github.com/AamAadmiParty/india-standalone-drupal/issues/146#issuecomment-35703214 .

tkuldeep commented 10 years ago

@sumeetpareek

sumeetpareek commented 10 years ago

Great! This is good to ship to prod then.

On Mon, Feb 24, 2014 at 12:45 PM, Kuldeep Singh Pal < notifications@github.com> wrote:

@sumeetpareek https://github.com/sumeetpareek

  • Updated module and this custom script code is added.

Reply to this email directly or view it on GitHubhttps://github.com/AamAadmiParty/india-standalone-drupal/issues/146#issuecomment-35862512 .

Sumeet Pareek

sumeetpareek commented 10 years ago

Done.