• Extensions
  • FriendsOfFlarum Analytics - tracking user visits

0E800 Your Piwik server returns a X-Frame-Options header that forbids inclusion in an iframe (which is probably a good choice for an analytics server). This extension relies on iframes to display the piwik dashboard I believe.

And Edge is probably ignoring that header...

FYI -
https://piwik.org/faq/troubleshooting/faq_147/

If you wish to include the whole Piwik in an iframe, edit your config/config.ini.php under the category [General] add the following line:

[General]
enable_framed_pages=1

If you also wish to enable the “Settings” pages (Manage websites, Users, etc.) to load in an iframe you can also add the setting:

enable_framed_settings=1

Above still did not work for me. However,

This plugin for Firefox allowed me to view the Analytics on Firefox.
https://addons.mozilla.org/en-us/firefox/addon/ignore-x-frame-options/

2 months later

hungyip I too am experiencing this. Ever manage to get it resolved? Piwik works fine for me, but no Googs

    2 months later

    Google Analitycs not working here also... as soon as i activate the extension with Google Analitycs enabled, the forum isn't showed correctly.

    @luceos , if one admin is logged in, the forum shows correctly, but for normal users logged in, the forum isn't showed properly.

    I'm running flarum beta-6:

    • /storage/logs/flarum.log is empty
    • I already run php flarum cache:clear

    I can't uninstall the extension using the option into flarum admin panel. Not sure if this extension to use only with Bazaar, but is causing too much issues here.

    I could uninstall with composer.

    If you need more info i can provide it.

      SierraKiloGulf Zeokat

      I haven't been able to give this extension attention yet, my apologies. Not sure when I can as other extensions have a higher priority. Perhaps @jordanjay29 would like to give this a shot ?

      Many thanks to @santiagobiali
      Posting here after attempting to solve without success.

      @luceos @jordanjay29

      Please let me know what I can do to help.
      Limited skill set here but I have spent quite some time on trying to get the extension to install properly with Flarum BETA 6. I am not sure whether anyone has it working. @luceoas mentioned higher up (Oct 2016) that it had been updated to work with Flarum BETA 6.

      Here are my steps and it failed each time (so I can reproduce):

      1. Installed Piwik 3.0.4 with a one-click Softaculous host install. Piwki URL: http://bikepost.cc/analytics

      2. Used

        composer require flagrow/flarum-ext-analytics
        php flarum cache:clear
      3. Analytics then is visible under the Flarum Admin page and enabling it (checking the check box) opens a pop-up window but its appearance is broken. I filled it out anyway, at that point the extension does get added to the left admin pane but it can't load the page.

      See screenshots and details below.
      (I have removed the extension and deleted the Piwik install after taking these screenshots).

      Details:
      Pointing to https://bikepost.cc/analytics
      Table 1
      Authentication Code (copied and pasted from the Piwik admin page under API)

      NOTE:
      After unchecking the Analytics check box under Extension, the option to uninstall becomes avail but doesn't work (see last screenshot).
      To remove it I have to use composer:

      composer remove flagrow/flarum-ext-analytics
      php flarum cache:clear

      Screenshots:

        bikepost
        I have it working.

        Its been a while, but pretty sure this was what solved my issue with it not displaying.

        https://piwik.org/faq/troubleshooting/faq_147/

        This is the error I get in console:

        Refused to display {SITE..} in a frame because it set multiple 'X-Frame-Options' headers with conflicting values ('SAMEORIGIN, DENY'). Falling back to 'deny'.

        Solution:

        https://serverfault.com/questions/801651/nginx-x-frame-options-iframe-wordpress

        In my case however, I had to remove add_header X-Frame-Options SAMEORIGIN; from both configs.

        sudo grep -R "X-Frame-Options" /etc/nginx/, make sure nothing has that string, then try reloading.

        Make you you have something like this in your sites-enabled config:

        location /flarum/analytics {
        index index.php index.html index.htm;
        try_files $uri $uri/ /index.php?q=$uri&$args;
        }

        POC:

        It works, here is the console errors:

        Invalid 'X-Frame-Options' header encountered when loading 'https://keys-daggers.org/analytics/piwik/index.php?idSite=1&token_auth=1fd4…oduleToWidgetize=Dashboard&actionToWidgetize=index&period=month&date=today': '' is not a recognized directive. The header will be ignored.

        index.php?module=Proxy&action=getCoreJs&cb=a3fb344…?cb=a3fb344……:6 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

        The theme is an eyesore, but its usable, ive been lazy, and the graphs are a mofo to customize.

        Thank you so much for your reply @0E800

        That's awesome. Relieved that it is working.
        Trying your solution right now. I'll report back.

        I see you have Pages at the bottom of your admin left pane.
        A search turned this up: https://github.com/sijad/flarum-ext-pages
        Is that what you use? I would love to ability to add a few pages to the site (Privacy Policy) etc.

        I am starting to think my issues isn't just with that flarum-ext-analytics

        I just tried with Pages and Upload and got a similar issue.
        Or is that not related?

        So odd. Everything is now displayed properly for both those two new extensions.

        Things "normalized" and I have no idea why.
        All I did is go in and out of the admin page, loaded it a new browser tab a few times.

        As for the Flagrow analytics extension, my error in console is different:

        Failed to load resource: net::ERR_CONNECTION_REFUSED

        Even after performing following these instructions: https://piwik.org/faq/troubleshooting/faq_147/
        My host uses apache servers so I couldn't follow the instructions here:
        https://serverfault.com/questions/801651/nginx-x-frame-options-iframe-wordpress

          bikepost browser cache, just had the same thing.. tried everything ; only now I noticed my chrome dev screen wasn't open (which can be set to disable cache all together if open)..

          Sigh, I feel your pain ?

          ? Glad it worked.

          If only I could get the analytics going, I would be so happy!

            bikepost

            Im not that familiar with Apache.

            Try this maybe?

            https://piwik.org/faq/how-to-update/faq_159/

            Also, in my Analytics settings, my location is:
            https://{SITE}/analytics/piwik

            bikepost

            Check the following line in Apache Web Server’s httpd.conf file

            Header always append X-Frame-Options SAMEORIGIN
            Try deleting that line.
            Or, if is says,
            Header always append X-Frame-Options NONE
            try setting it to SAMEORIGIN.
            Restart Apache Web Server

            (someone correct me if thats a major security concern, just saying that I am unable to get Piwik analytics to show unless all references are removed)

            Reference: https://geekflare.com/secure-apache-from-clickjacking-with-x-frame-options/

              0E800 Thank you so much @0E800 Can't wait to try this tomorrow. Boarding in 10 mns.

              Keep an eye on this thread I posted on Piwik's forum.
              https://forum.piwik.org/t/connection-error-in-iframe/24906/1

              I will report back either way.

              Amazing we haven't ran into this issue more often on the board here if people have the Analytics up and running with BETA 6.

              Thank you again. I really appreciate it.

              @0E800 thanks for jumping on the support-train on our behalf ? Very much appreciated.

              I looked at the console error message closer and noticed the URL the extension was trying to reach had https:// twice so in the extension settings, I pasted the directory for the Piwik install without http:// (the extension adds it) and it worked!!!

              I feel so silly.

              The name of the extension in the left pane is still messed up and Piwik is showing 0 for every metric but at least now, the iFrame content loads.

              @luceos HTH, mostly I just like troubleshooting things. Thank you. ?

              @bikepost Glad you were able to solve the issue. Way to go.

              0E800 someone correct me if thats a major security concern, just saying that I am unable to get Piwik analytics to show unless all references are removed

              While not a big risk, I would advice against removing that header. SAMEORIGIN should be fine, depending on what you host on the same domain. If there's any place users or third-party might place custom HTML, in particular IFRAMES, I strongly suggest not disabling frame protection.

              Allowing inclusion of your analytics admin panel inside another website is dangerous, one could trick you into clicking various options by placing it in an iframe behind content on a webpage.

              You're probably a lot safer if your analytics server can only be accessed directly. That header has no impact on the correct working of the javascript tracking code.

              I'm not sure why that iframe thing was added to the extension in the first place ? It's not required for the tracking to work and users might downgrade their security to use it...

              By the way X-Frame-Options is now deprecated, the browser will use the frame setting provided via CSP if available.

                bikepost could you please comment on why the extension name is all garbled in the left pane of the admin page?

                I'm not sure what you mean ? I don't have a working install with that panel right now. Do you have a picture ?