OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Google Analytic Main Content URLs (OJS 2.2.2)

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Google Analytic Main Content URLs (OJS 2.2.2)

Postby hekutoru2kx » Sun Aug 08, 2010 10:30 pm

Hi, it's me again...

I'm using the OJS 2.2.2 and the Google Analytic Generic Plugin (ga.js). The thing is that it only displays the main url of the page and is like if it isn't tracking all of them. I'm also using the GA in a blogspot blog and it show the different pages according to the tags.

The main page of the site (http://revistas.uis.edu.co/) is tied to a index.html and that html calls the index.php. I have added the script that ga needs in the html and also the generic plugin enabled. I think the code in the .html should not be a problem with it. Am I doing it wrong? or perphaps is the plugin that's not working. I'm thinking anyway in updating the OJS to the last version, but i want to know if this have something to do with it.

Thanq
hekutoru2kx
 
Posts: 71
Joined: Wed Jul 28, 2010 12:47 pm

Re: Google Analytic Main Content URLs (OJS 2.2.2)

Postby hekutoru2kx » Mon Aug 09, 2010 6:54 am

Last Update:
I took the code out from the index.html for the weekend and it didnt register anything. The plugin was enable and all.

I search throught the generated code of each page and the ga php tracking code appears there. But there's something weird, there are two tracking codes. The firs of them is in the beginning of the code and it shows a different ID code, the second is in the bottom and it shows the ID code i need for the GA.

I also disabled the ga (refreshed templates) and the code that dissapears is the one in the bottom, but not the one in the beggining. According to all this, it just let me to a conclusion and also let me a lil confused. The generic plugin is not working and I don't know why is adding a weird tracking code in my page.

I read in the Google help about GA is not tracking and one of the possible things is a deprecated version of the ga.js. So how can i know if I'm using a updated version of the GS.
hekutoru2kx
 
Posts: 71
Joined: Wed Jul 28, 2010 12:47 pm

Re: Google Analytic Main Content URLs (OJS 2.2.2)

Postby hekutoru2kx » Mon Aug 09, 2010 9:38 am

I found the problem if the 'weird' code. One of the guys working with me add the code in the index.php. I also found that it load the ga.js from google everytime he opens the page. I'll wait a little more to see the effects of the new changes...
hekutoru2kx
 
Posts: 71
Joined: Wed Jul 28, 2010 12:47 pm

Re: Google Analytic Main Content URLs (OJS 2.2.2)

Postby hekutoru2kx » Tue Aug 10, 2010 9:24 am

Well, I'm a lil sad 'cuz i don't have any help. But i know someone will be help with my mistakes ;).

The generic plugin is not really working. I checked the Page Generated Code and the code of the GA is not putting the "UA" in the code tracker, just the numbers (Ex. "17440572-2" instead of "UA-17440572-2").

I put the tracking code manually and it is working, but it shows 3 warnings, so I had to disabled the warnings. It's also tracking the complete URLs of the path. I'll check later fully deactivating the generic plugin and I'll let you know.

This is the code I put manually:
Code: Select all
<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-17440572-2");
pageTracker._trackPageview();
} catch(err) {}</script>


This is the code that the plugin is generating
Code: Select all
<!-- Google Analytics -->
<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">
var pageTracker = _gat._getTracker("17440572-2");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- /Google Analytics -->
hekutoru2kx
 
Posts: 71
Joined: Wed Jul 28, 2010 12:47 pm

Re: Google Analytic Main Content URLs (OJS 2.2.2)

Postby hekutoru2kx » Wed Aug 11, 2010 5:49 am

Putting manually the code works really great and it tracks all the URLs. I checked again the plugin i put the full code in "" (Ex. "UA-17440572-2") and its working great too. The code needs to be in "", because if it isn't it will never track the pages (That was the problem when i said it wasnt putting the UA). Problem solve for now.
hekutoru2kx
 
Posts: 71
Joined: Wed Jul 28, 2010 12:47 pm

Re: Google Analytic Main Content URLs (OJS 2.2.2)

Postby hekutoru2kx » Wed Aug 11, 2010 2:51 pm

I disabled all the manually codes and just let the generic plugins working. Is working great, it is tracking perfectly all the 13 journals the site has.

But, my boss told me we need to track also the main page. The one that shows the journal list when no journal is selected. But the GA generic pluing is just for each journal. How can i do it?. I mean, i know i can add it in the index.php but i'll be back to earlier problems...
hekutoru2kx
 
Posts: 71
Joined: Wed Jul 28, 2010 12:47 pm

Re: Google Analytic Main Content URLs (OJS 2.2.2)

Postby hekutoru2kx » Mon Aug 16, 2010 3:13 pm

I couldn't find a way to track the main page with the plugin. So I'm using the Generic Plugin to track the journals, and /templates/index/site.tpl edition (add the {include file="path"} right before the footer to call a file with the GA php code.

Everything is working perfect! Next Step is upgrade the OJS version :S
hekutoru2kx
 
Posts: 71
Joined: Wed Jul 28, 2010 12:47 pm

Re: Google Analytic Main Content URLs (OJS 2.2.2)

Postby newone » Tue Nov 02, 2010 11:41 am

Thanks for all the updating.

I think something may not be working with Google Analytics plugin. I am tracking it now to see if it is picking up any stats.

The issue is that when the plugin is enabled using either method (urchin or new GA), it does not show the google analytics code in the source. I tried it both for alternate header and it is not working. The only way I got it to show is by adding it to footer and article templates in the common directory.

I will update if something changes.
newone
 
Posts: 131
Joined: Tue Nov 17, 2009 2:30 am


Return to OJS Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest