Jump to content
thirty bees forum

Matomo native module - use proxy script feature out of date?


30knees

Recommended Posts

I'm unable to get the use proxy script feature to work. While researching, I came across these instructions: https://github.com/matomo-org/tracker-proxy?tab=readme-ov-file

It doesn't look like the files mentioned that should be downloaded are installed via the tb native Matomo module:

Quote

Is this because the native module is out of date or is it because of something else?

Link to comment
Share on other sites

And a follow-up question: Is there any analytical benefit to using the native Matomo module compared to just using the tracking code?

Also, sometimes when I visit the settings page I get this error and then suddenly it's gone again, without any changes being made:

Quote

Unable to connect to the API {"result":"error","message":"Unable to authenticate with the provided token. It is either invalid, expired or is required to be sent as a POST parameter."}

 

Edited by 30knees
Link to comment
Share on other sites

  • 2 weeks later...
On 2/27/2024 at 7:23 PM, 30knees said:

I'm unable to get the use proxy script feature to work. While researching, I came across these instructions: https://github.com/matomo-org/tracker-proxy?tab=readme-ov-file

It doesn't look like the files mentioned that should be downloaded are installed via the tb native Matomo module:

Is this because the native module is out of date or is it because of something else?

As this is a tb native module, would you be able to help here, @datakick?

Link to comment
Share on other sites

  • 1 month later...

Important msg for Matomo users

While browsing Google Search Console today, I discovered that GoogleBot was only loading small section of my product pages.

Error from GSC: "Page resources. Failed to load 1/57 of resources"

GoogleBot was blocking by matomo.js file.

The solution is simple, add following line to script:

_paq.push(['disableAlwaysUseSendBeacon']);

Example of full code with added line:

<script>
        var _paq = window._paq = window._paq || [];
        /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
        _paq.push(['trackPageView']);
        _paq.push(['enableLinkTracking']);
        _paq.push(['disableAlwaysUseSendBeacon']);
        (function() {
          var u="https://store-domain.com/";
          _paq.push(['setTrackerUrl', u+'matomo.php']);
          _paq.push(['setSiteId', '2']);
          var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
          g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
        })();
</script>

If you are using Matomo Web Analytics module add code to file: /modules/piwikanalyticsjs/views/templates/hook/jstracking.tpl (line 27)

I discovered this when I saw that the number of reviews visible in a Google search had started to fall rapidly.

reviews.jpg

Edited by Adik
  • Thanks 1
Link to comment
Share on other sites

On 4/15/2024 at 7:11 PM, Adik said:

If you are using Matomo Web Analytics module add code to file: /modules/piwikanalyticsjs/views/templates/hook/jstracking.tpl (line 27)

Do you mean that

(...)
{if $PIWIK_USE_PROXY}
      _paq.push(['setTrackerUrl', u]);
    {else}

becomes 

_paq.push(['disableAlwaysUseSendBeacon']);
{if $PIWIK_USE_PROXY}
      _paq.push(['setTrackerUrl', u]);
    {else}

Link to comment
Share on other sites

I added code after enableLinkTracking :

 {if isset($PIWIK_RCOOKIE_TIMEOUT)}
      _paq.push(['setReferralCookieTimeout', '{$PIWIK_RCOOKIE_TIMEOUT|escape:'javascript'}']);
 {/if}
      _paq.push(['enableLinkTracking']);
      _paq.push(['disableAlwaysUseSendBeacon']);

 

Edited by Adik
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...