留言板

Add Piwik to Liferay 7

thumbnail
Massimo Bevilacqua,修改在6 年前。

Add Piwik to Liferay 7

Regular Member 帖子: 210 加入日期: 16-12-27 最近的帖子
Hello everybody,

I need to add piwik in liferay 7 but I don't know how to do it.
I searched on google but I haven't find nothing that help me to understand.

I saw that in Control panel -> Instance setting ->Miscellaneus -> Analytics
there is "Enter one analytics system name per line" and I found "Google and Piwik".

Could anyone help me to understand how to use it?

Thank you
thumbnail
Miguel Ángel Pau,修改在6 年前。

RE: Add Piwik to Liferay 7

Regular Member 帖子: 172 加入日期: 05-4-27 最近的帖子
Hi Massimo! I found this thread looking for another topic and I took the opportunity to answer you emoticon

Analytics and Piwik are set by default then you only need to go to Site Configuration > Advanced > Paste the Piwik script

;) Regards
thumbnail
Massimo Bevilacqua,修改在6 年前。

RE: Add Piwik to Liferay 7

Regular Member 帖子: 210 加入日期: 16-12-27 最近的帖子
Thank you for your answer,

but my problem was how to install piwik inside liferay. In order to have the script you must install piwik.
I remeber it is based on PHP and tomcat doesn't support it.

If you know how to install it in a liferay site please let me know!

Best regards

Massimo
thumbnail
Miguel Ángel Pau,修改在6 年前。

RE: Add Piwik to Liferay 7

Regular Member 帖子: 172 加入日期: 05-4-27 最近的帖子
Hi again Massimo, that is another topic... ;)

You can install Piwik on the same server under apache or in a remote server, different from your Liferay installation (recommended).
After that you only need to paste the tracking script on Site Configuration > Advanced

Something like this:

<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//{$PIWIK_URL}/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', {$IDSITE}]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->
thumbnail
Massimo Bevilacqua,修改在6 年前。

RE: Add Piwik to Liferay 7

Regular Member 帖子: 210 加入日期: 16-12-27 最近的帖子
thank you, I will try