[OMP] Google Analytics not installed

Hello,

I followed the instructions in the link http://pkp.sfu.ca/support/forum/viewtopic.php?f=40&t=9585 to add Google Analytics to my installation of OMP , however G. indicates Analytics tracking code is not installed .

I 'm seeing the source of my page code and the code appears in the content .

The contents of my file /templates/common/footer.tpl

<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', 'UA-43112892-12', 'auto');
  ga('send', 'pageview');

</script>

{**
 * templates/common/footer.tpl
 *
 * Copyright (c) 2014 Simon Fraser University Library
 * Copyright (c) 2003-2014 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * Common site footer.
 *}
{assign var=brandImage value="templates/images/omp_brand.png"}
{assign var=packageKey value="common.openMonographPress"}
{assign var=pkpLink value="http://pkp.sfu.ca/omp"}
{include file="core:common/footer.tpl"}

What could be happening ?

Thank you!

Andrés

Hi Andrés,

Which instructions did you follow? I think that’s the wrong link.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alex,

The link is http://pkp.sfu.ca/support/forum/viewtopic.php?f=40&t=9585

Regards,

Andrés

Hi Andrés,

Thanks. Because you’re working in Smarty templates, you need to escape certain characters. The best way to do that is to wrap the Google Analytics code in Smarty’s {literal} tag, e.g.:

{literal} (Google Analytics code here) {/literal}

Regards,
Alec Smecher
Public Knowledge Project Team

Alec,

Thanks for the help. This would be the correct way ?

{**
 * templates/common/footer.tpl
 *
 * Copyright (c) 2014 Simon Fraser University Library
 * Copyright (c) 2003-2014 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * Common site footer.
 *}

{literal} 
<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', 'UA-43112892-12', 'auto');
  ga('send', 'pageview');

</script>
{/literal}

{assign var=brandImage value="templates/images/omp_brand.png"}
{assign var=packageKey value="common.openMonographPress"}
{assign var=pkpLink value="http://pkp.sfu.ca/omp"}
{include file="core:common/footer.tpl"}

Hi @aovalle,

At a glance that looks fine to me.

Regards,
Alec Smecher
Public Knowledge Project Team

Alec,

Unfortunately throws the same error. Tracking code not installed.

What could it be ?

Andrés

Hi Andrés,

Is there a URL to your installation that’s available publicly?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes , the address is: http://ediciones.ucc.edu.co/

Hi @aovalle,

I don’t see anything wrong there ta a glance – the code is included and appears to execute. I’d suggest waiting for a while and trying again.

Regards,
Alec Smecher
Public Knowledge Project Team

Alec,

Thanks for your help.

The Google Analytics is configured correctly in this moment.

Thank’s a lot!

Andrés