Diazo ignores JavaScript for web statistics

I have a plone 4.2.1 website and I use various diazo themes. I also use Piwik for web statistics. Unfortunately, javascript for web statistics is completely ignored when one of the diazo themes is installed. I tried to edit the rules.xml file as suggested at https://groups.google.com/forum/?fromgroups=#!topic/plone-users/VM4b51ergFA , but adding

<!-- Google Analytics JavaScript --> <after theme-children="/html/body" content="/html/body/div[@id='visual-portal-wrapper']/div/script" /> 

not working for me.

Is there any other option that I can use to fix this problem?

Thanks Julian

+4
source share
1 answer

The plone.analytics viewlet is displayed in the window of the footer window manager:

 <browser:viewlet name="plone.analytics" manager="plone.app.layout.viewlets.interfaces.IPortalFooter" class=".view.AnalyticsViewlet" permission="zope2.View" /> 

The excerpt is displayed as is, so you can identify the script tag as you want.

Are you trying to try

 <script id="plone-analytics" ...>YOUR SCRIPT...</script> 

And change the rules.xml to put # plone-analytics in the footer

In Plone 4.2, at least plone.analytics is not in the visual-portal-wrapper, so the rule you are trying will not work.

+4
source

Source: https://habr.com/ru/post/1440361/


All Articles