Announcement

  •  » Extensions
  •  » HowTo insert Google Analytics code in footer/header?

#16 2010-06-28 21:59:14

Ericnet
Translation Team
2010-04-02
19

Re: HowTo insert Google Analytics code in footer/header?

Hi,
I have insert VDigital code, but if I view html code in my browser don't have Analytics code

Last edited by Ericnet (2010-06-28 21:59:58)

Offline

 

#17 2010-06-29 10:41:08

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: HowTo insert Google Analytics code in footer/header?

[extension by Piwigo Team] LocalFiles Editor
Templates
Edit your footer.tpl (to make sure create a new one based on default/template/footer.tpl)

Insert
Analytics Standard codes in your footer.tpl before
</div> <!-- copyright -->

{literal}
<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>
{/literal}

Don't forget to replace UA-xxxxxx-x by your Google Analytics web property ID.

When done don't forget to active your footer.tpl in Admin > Configuration > template.


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#18 2011-10-14 08:03:30

maddy
Guest

Re: HowTo insert Google Analytics code in footer/header?

helpful...its workinf fine with  {literal}  tag..
thanks

 

#19 2011-10-14 09:33:43

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13181

Re: HowTo insert Google Analytics code in footer/header?

maddy wrote:

helpful...its workinf fine with  {literal}  tag..
thanks

Did you try [extension by sakkhho] Statistics? It's the simplest way to have Google Analytics on your Piwigo gallery.


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 
  •  » Extensions
  •  » HowTo insert Google Analytics code in footer/header?

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact