Code Monkey home page Code Monkey logo

kirby-matomo's People

Contributors

johannschopplich avatar mrflix avatar plantalabs avatar preya avatar sylvainjule avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kirby-matomo's Issues

Cache folder seems to be empty when this plugin is active

Hello there,

I notice this issue with the websites I'm working with. Separate hosting but same issue when this plugin is active, the cache folders doesn't create the static files cache although the folders does get created.

When I disable the plugin and run Matomo manually it's working.

Any ideas where that could come from?

More Graceful Display When Insufficient Data Available

When there is insufficient data to calculate a current number, the fields will often display a 'NaN' text - guessing that is because it's trying to do a 0-based division).

screen shot 2019-02-08 at 10 11 01 am

This makes the display look like an unintended error happened - not that there is still 'insufficient data' to provide a response... It would be immensely helpful if the plugin would trap those situations, and would provide a nicer message in the interface. ๐Ÿ™

Please Add a 'Buy Me a Coffee/Beer' Button ๐Ÿ˜

Many developers using your plugin may already have affiliate links of their own to purchase a Kirby license. You can make it easy for anyone to contribute a little to your costs by adding a 'buy me a coffee' or 'buy me a beer' button in your docs, too! ๐Ÿ˜‰

Snippet does not load

I have a clean installation of your Matomo plugin running on my webserver.

According to the documentation the tracking code should be loaded once the snippet was added to the site. However the code doesn't load. The same issue occurs when I set the option 'sylvainjule.matomo.active' => true .

In my case I just removed the <?php if(Matomo::allowed()) : ?> clause inside /lib/snippets/matomo.php.

Might be a simple bug โ“

Page widget does not seem to show any existing tracking data

Hello,

I have this fantastic plugin in a Kirby 3.7.2.1 installation

I have the dashboard in a tab in site.yml, fully working, like this:

  analytics:
    icon: chart
    columns:
      - width: 3/4
        sections:
          main:
            type: matomo-main
      - width: 1/4
        sections:
          sidebar:
            type: matomo-sidebar      

It shows data, and this data seems to match the one that I see at Matomo's own dashboard.

I also have a widget in a type of page, like this:

    sections:
      matomo:
        type: matomo-page
        period: year
        overview: true

Both this type of page and its parent are always unlisted (not draft)

Matomo records visits to these pages, but not the widget:

image

Config options:

    'sylvainjule.matomo.url' => 'https://xxxxxxxx.com/matomo',
    'sylvainjule.matomo.id' => '3',
    'sylvainjule.matomo.token' => 'xxxxxxxxxxxxxxxxxxxxx',
    'sylvainjule.matomo.active' => true,
    'sylvainjule.matomo.disableCookies' => true,

As you see I use cookie-less Matomo.

I have no routes in config.

How to troubleshoot this?

Thanks

too many request

Hi!
Since I have updated Matomo 3.6 to 4.2, only one widget (randomly) working.

For exemple here I only have the chart working :
Capture dโ€™eฬcran 2021-02-25 aฬ€ 14 10 50

This type of error showing up for 4 other calls :
error: "file_get_contents(https://mydomain.fr/?module=API&amp;methth=mytoken&amp;format=JSON&amp;urls[0]=method%3DVisitsSummary.getVisits%26idSite%3D3%26period%3Dday%26date%3Dtoday&amp;urls[1]=method%3DVisitsSummary.getVisits%26idSite%3D3%26period%3Dday%26date%3Dlast7&amp;urls[2]=method%3DVisitsSummary.getVisits%26idSite%3D3%26period%3Dmonth%26date%3Dtoday&amp;urls[3]=method%3DVisitsSummary.getVisits%26idSite%3D3%26period%3Dyear%26date%3Dtoday): failed to open stream: HTTP request failed! HTTP/1.1 429 Too Many Requests\r\n"

I have tested all the request individually and they are working.

Have you any clue about this error ?

Thanks

How can I see tracking data of my blog posts?

In the popularPages module I see the /blog page, but it's children are nowhere to be found.
Enabling the matomo-page module on the post blueprint always returns "There is no data to display".

If I check in Matomo's dashboard I can clearly see that the urls are being tracked correctly. Chrome's network inspector also shows me that the URL that is requestet in the matomo-page module is the correct, public, one but there never is any data.

Am I overlooking something?

Panel Error: The JSON response could not be parsed / Forbidden / You don't have permission to access this resource.

Hello,

I installed the matomo on a subdomain https://matomo.monsite.com

When I connect to matomo everything is ok, however in the panel, the plugin does not seem to be able to connect.

The 3 factors are well fulfilled:
'sylvainjule.matomo.url' => 'https://matomo.monsite.com',
'sylvainjule.matomo.id' => '1',
'sylvainjule.matomo.token' => 'MYTOKEN',
'sylvainjule.matomo.trackUsers' => true,
'sylvainjule.matomo.disableCookies' => true,

My kirby settings are:
Kirby version: 3.9.1
PHP version: 8.1.6
Serveur: Apache

https://monsite.com/api/matomo-panel/ display:
{"status":"error","message":"No route found for path: "matomo-panel" and request method: "GET"","code":404,"key":null,"details":[]}

I don't understand what's wrong.

Change from 'piwik' to 'matomo' may be needed in snippet

I couldn't get the built-in snippet to work in a site I'm building atm, and when I pasted the javascript snippet directly from Matomo, it worked. When comparing the 2, the only things I could notice different were

  1. the slash at the end of the Matomo URL - which the snippet didn't add (either a check should be added in the snippet, or the docs should explicitly mention it)
  2. the fact that the snippet refers to 'piwik.php' and 'piwik.js', when the new versions of Matomo now use 'matomo.php' and 'matomo.js'.

To be totally honest, not sure whether the change from 'piwik' to 'matomo' was the cause, but it's my best guess...

Once again, thank you SO MUCH for such a terrific plugin.

/ at the end of the url

3.1. url (required)

Where your matomo install is:

'sylvainjule.matomo.url' => 'https://analytics.yourdomain.com'

At the end of the url if I forgot the "/" the snippet matomo doesn't work with my installation of matomo. Is this the expected behavior ?

Use Custom Routes for Pages

We are currently deploying a site that makes extensive use of custom routes to 'remap' a page's native URL to a more logical and user-memorable one. So, for example, an article on URL...:

https://example.com/home/content/articles/movies-to-watch-with-your-dog

...becomes:

https://example.com/pets/movies-to-watch-with-your-dog

Matomo is already able to catch this, and tracks all visits to custom-routed URLs normally in the Matomo dashboard. Unfortunately, we cannot use the 'page widget' in the Panel, because it looks for the tracked data based on the 'original' (non-routed) URL...

It would be nice if we could let the plugin know that certain pages have custom URLs, so it could retrieve the data from the 'correct' URL instead. Maybe this could be done through a plugin option, or - better still - through a custom blueprint option using the query language. Something like this, in our page's article.yml blueprint:

options:
  matomopath: "https://example.com/{{page.category}}/{{page.slug}}"

Panel blueprint issue

Hello,
i tried to use your blueprints, but my kirby does not know or shows an error
" Argument 2 passed to Kirby\Cms\Blueprint::normalizeColumns() must be of the type array, string given, called in /www/htdocs/w013ae79/brunnerthomas.com/kirby/src/Cms/Blueprint.php on line 694 "
when i use the type: matomo-main or matomo-sidebar
"
matomo:
label: Matomo Analytics
columns:
- width: 3/4
sections:
main:
type: matomo-main
- width: 1/4
sections:
sidebar:
type: matomo-sidebar "

Do you have any clue why?

readme missing '

theres a bug in the readme.
under "TLDR โ€“ Just get me started" is a code snippet:

return array(
    'sylvainjule.matomo.url'        => 'http://your-matomo.url',
    'sylvainjule.matomo.id'         => 'mywebsite',
    'sylvainjule.matomo.token'      => 'token_auth,
);

heres a missing ' at 'token_auth, -> 'token_auth',

still no data

even with the fix in V 1.0.6 no data get displayed.

In the readme it says to copy <?php echo snippet('matomo') ?> into the footer. Later it says to put this somewhere <?php snippet('matomo'); ?> but both echos don't seem to work. The snippet doesn't get inserted.

Compatibility with Kirby v4

Good afternoon

I tried the plugins blueprints in the panel with the most current Kirby v4 alpha but it does not work - I get some weird API redirects.

Are there plans to make the plugin work with v4?

Thanks
Andreas

Incompatible with Kirby 3.6.1

The plugin doesn't work anymore with Kirby 3.6.1:

index.js:1 TypeError: this.load is not a function
at a.created (index.js?1638272587:formatted:17255)
at Vt (vendor.js:6)
at nn (vendor.js:6)
at a.Cn._init (vendor.js:6)
at new a (vendor.js:6)
at vendor.js:6
at init (vendor.js:6)
at vendor.js:6
at f (vendor.js:6)
at v (vendor.js:6)

created() {
                this.load().then(d=>{
                    this.url = d.url,
                    this.link = d.link,
                    this.realtime = d.realtime,
                    this.summary = d.summary
                }

https://github.com/sylvainjule/kirby-matomo/blob/d3f546ef60166022349ae1d8ef2da8ad165fff1a/src/components/sidebar.vue

image

Main Chart does not show correct data

The chart shows only data from "Today" correctly.
Matomo-Version: 3.9.1

Here's a screenshot from the matomo dashboard
matomo

The api responses look reasonable to me. (I uploaded the json responses here)

and that's what the plugin in kirby looks like:
Today looks right.
heute

7 days is wrong
7days

Month is actually correct...since it's the first day of the month today.
month

the chart is ok, but the labels are undefined
year

summary

[feature request] Stats in separate panel area

Hi,

Would it be possible to move the stats onto separate panel area?

The rational behind having the matomo stats in separate panel area, is to declutter the site page in panel.

I looked into implementing it myself, but got lost midway through. According to Kirby Team, this is apparently an easy task. Would you possibly consider it please.

Thank you

Blueprint not working

I get an error "TypeError: Cannot read property 'current' of undefined" in the blueprint for individual Matomo page statistics while using Kirby 3.6 alpha:

matomo:
        type: matomo-page
        overview: true

TypeError: Cannot read property 'current' of undefined
at a.currentLanguage (index.js?1629713017:formatted:12463)
at vn.get (vendor.js:6)
at vn.evaluate (vendor.js:6)
at a.currentLanguage (vendor.js:6)
at a. (vendor.js:6)
at vn.get (vendor.js:6)
at new vn (vendor.js:6)
at a.t.$watch (vendor.js:6)
at _n (vendor.js:6)
at vendor.js:6

This is the mentioned line in the code:

        currentLanguage: function() {
            var e = this.$store.state.languages.current;
            return !!e && e.code
        },

Please add an option to cache matomo.js script

currently I'm trying to cache the downloaded matomo.js tracking script, because not caching it causes an performance issue in PageSpeed Insights.

would be cool to have an option to cache the matomo.js script with your plugin.

user detection

Detection user on matomoo.php file on line 24 is
if(!option('sylvainjule.matomo.trackUsers') && site()->user()) {
it should not be
if(!option('sylvainjule.matomo.trackUsers') && kirby()->user()) {

Incorrectly written word in German translation

Hey there,

thank you very much for this terrific plugin. I love how it fits perfectly into Kirby!

Within the overview widget I found a incorrectly written word in German translation:

Bildschirmfoto 2021-10-25 um 12 06 17

This is caused by the toLowerCase() function on $t('matomo.visits') in line

<div class="details">{{ $t('matomo.visits').toLowerCase() }} {{ $t('matomo.period.'+currentPeriod) }}.</div>

as Besuche must always be capitalized in German.

I'm not sure how to deal with this issue, as the lowercasing seems to be intended within the other languages?

Console 400 errors in the panel

I'm getting various 400 (Bad Request) console errors when viewing the Matomo page in the panel:

Screen Shot 2019-09-16 at 15 16 36

When looking directly at these pages, they look like this:

Screen Shot 2019-09-16 at 15 16 09

Is this a specific Kirby API authentification issue?

No data displayed!

Hello !

I have installed and configured the Matomo plugin but no information is displayed and no error is displayed to understand what it's all about.

  1. I've been using Matomo for a while so the data exists
  2. the URL + siteId + token information are correctly filled in
  3. When I click on the Matomo link of the plugin I arrive correctly at my destination!
  4. the Debug option is set to true in the configuration
  • Matomo v4.0.0
  • working on localhost

I don't know how to solve the problem. :-(

Capture dโ€™eฬcran 2020-11-25 aฬ€ 19 14 53

No data display but works after "cleanCache" from Janitor

Hi,

I'm trying the plugin and so far it works well. Except, that after some visits, the panel starts to show "no data displayed". When I check the console, it took 2 minutes to try to fetch the API and finally it returns "failed to open stream".

But if I use the Janitor buit-in job "cleanCache" from Janitor plugin. It works? I didn't set anything in the config.php regarding the cache. I know my host (gandi) used varnish, but not sure it is related? Any clues?

Ampersands in API URL get encoded

On my installation the plugin can't access my Matomo API. I checked the URL it's trying to use an it seems that all special characters get encoded. This is the actual error Firefox is throwing: (I changed the URL and the token).

file_get_contents(https://my-website.de/matomo?module=API&amp;method=API.getBulkRequest&amp;token_auth=MY_TOKEN&amp;format=JSON&amp;urls[0]=method%3DReferrers.getReferrerType%26idSite%3D1%26period%3Dmonth%26date%3Dtoday%26language%3Dde%26filter_limit%3D5&amp;urls[1]=method%3DReferrers.getWebsites%26idSite%3D1%26period%3Dmonth%26date%3Dtoday%26language%3Dde%26filter_limit%3D5&amp;urls[2]=method%3DReferrers.getSocials%26idSite%3D1%26period%3Dmonth%26date%3Dtoday%26language%3Dde%26filter_limit%3D5&amp;urls[3]=method%3DDevicesDetection.getType%26idSite%3D1%26period%3Dmonth%26date%3Dtoday%26language%3Dde%26filter_limit%3D5&amp;urls[4]=method%3DReferrers.getKeywords%26idSite%3D1%26period%3Dmonth%26date%3Dtoday%26language%3Dde%26filter_limit%3D5&amp;urls[5]=method%3DActions.getPageUrls%26idSite%3D1%26period%3Dmonth%26date%3Dtoday%26language%3Dde%26filter_limit%3D5): failed to open stream: HTTP request failed!

If I replace all &amp; with ampersands again the URL works in the browser. Do you have any idea how I could fix this?

A 'Content' Widget for Pages Tracked as 'Contents'

Matomo has a built-in function called 'Content Tracking', which allows you to track how many times specific page elements are displayed in the viewport, and clicked by the user. This is often used, for example, for Ad tracking - counting how many times each ad was shown and clicked.

When developing site with 'content tracking', the content being tracked by client is often going to be managed in Kirby: usually, each 'content' is going to have its own page in Kirby. In the Ad tracking example, for instance, each Ad would have its own page in the Kirby backend - where the user can specify things like the dates the ad should start/stop showing on the site, and the pages where it should be shown.

When we have Kirby pages that are Matomo 'contents', the page widget doesn't work - because these are not 'pages', they are only elements that appear inside other pages. But we still need them tracked!... For this situation, we would need a special 'content' widget instead of a page widget - and a way to specify the content URL/details to be retrieved from Matomo. Like the page widget, the 'content widget' could have some useful summary information - like how many times the content was displayed and interacted with in the last month - which would save the user having to go into the Matomo dashboard to look.

Here is some useful information from the Matomo docs:

matomo.php tracking snippet / site id

In kirby-matomo/lib/snippets/matomo.php the site id is hard-coded to:

_paq.push(['setSiteId', '1']);

Should this use sylvainjule.matomo.id from config.php?

no visitors are displayed in matamo

I installed matamo and did a test with a standalone test.php page containing the tracking code generated by matamo.
Visitors from the test.php page are displayed in matamo.

I also added the configuration to /site/config/config.php:

return array(
'sylvainjule.matomo.url' => 'http://your-matomo.url',
'sylvainjule.matomo.id' => 'mywebsite',
'sylvainjule.matomo.token' => 'token_auth',
);

of course with my values.

Is it correct to add this section at the very end of config.php, i.e. after the last "];"?

I also tried to include the code but I'm not sure where it belongs.

Do you have any idea what is wrong on my side?

Composer problem

When installing your (excellent) plugin via composer, I get this:

The section type "matomo-main" is not valid

.. when trying to include it in my blueprint .. any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.