Fórumok

Adding google analystics, sitewde and or by age.

JackB Nimble, módosítva 9 év-val korábban

Adding google analystics, sitewde and or by age.

New Member Bejegyzések: 4 Csatlakozás dátuma: 2015.01.22. Legújabb bejegyzések
Hi,

I'm using Liferay version 5.23. We've been asked to add Google analytics to the portal, although it's not yet clear if it's per page or per site. I think I can see how to add the analytics per page, i.e. by pasting in the analytics javascript. However, for site-wide analtyics, the documentation suggests adding code to the following file:

"/html/common/themes/bottom-ext.jsp", which I've located.

However, it also says that for Velocity themes, add "$taglibLiferay.include("/html/common/themes/bottom-ext.jsp")" to the file
"/html/themes/[theme_name]/templates/portal_normal.vm".

And there are actually three separate "theme_names" which have the portal_normal.vm:

/html/themes/_unstlyed/templates/portal_normal.vm
/html/themes/classic/templates/portal_normal.vm
/html/themes/control_panel/templates/portal_normal.vm

My question is, do I simply add the google analytics code to each of these?

Also, to revisit my opening assumption, it appears that by selecting on "manage pages" for a community, then selecting a page, I'm able to enter or paste javascript (i.e. the Google Analytics), into each page. Note this doesn't conform to the current documentation, which suggests entering the Google Analytics ID via a "monitoring" tab", which doesn't appear to exist. Perhaps this is due to the fact I'm running an older version? Or am I missing something?

Thanks!
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: Adding google analystics, sitewde and or by age.

Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
JackB Nimble:
However, it also says that for Velocity themes, add "$taglibLiferay.include("/html/common/themes/bottom-ext.jsp")" to the file
"/html/themes/[theme_name]/templates/portal_normal.vm".

And there are actually three separate "theme_names" which have the portal_normal.vm:

/html/themes/_unstlyed/templates/portal_normal.vm
/html/themes/classic/templates/portal_normal.vm
/html/themes/control_panel/templates/portal_normal.vm

My question is, do I simply add the google analytics code to each of these?


No. theme_name is a placeholder for your own local theme. You're probably not using unstyled, classic, or the control panel as your main site theme and these don't need to be touched.

Also, to revisit my opening assumption, it appears that by selecting on "manage pages" for a community, then selecting a page, I'm able to enter or paste javascript (i.e. the Google Analytics), into each page. Note this doesn't conform to the current documentation, which suggests entering the Google Analytics ID via a "monitoring" tab", which doesn't appear to exist. Perhaps this is due to the fact I'm running an older version? Or am I missing something?


Not just an old version, a dead version. Liferay EE 5.2 is now only supported under the limited support plan, so 5.2.3 CE is not supported at all. You won't find an real doco for 5.2.3 (outside of dead articles in the wiki).