Cannot Log PDF Download - Matomo Returns 406 Status

Có thể bạn quan tâm

I’m using Matomo 3.13.4 and cannot track a linked PDF download.

Matomo reports other Wordpress (php-generated) page activity completely and correctly as far as I’ve seen. Campaigns (names and keyword) are logged correctly.

But I’m not seeing anything in Downloads, or Goals where I added the PDF filename as a goal.

This is a new, standard (i.e from the regular Matomo download page) Matomo install for a Wordpress site, which I have not used before; I’m normally a Joomla admin. I don’t beieve that this is Wordpress-related.

I captured network traffic in the FF console debugger while accessing the PDF link. I was most surprised to see Matomo return a 406 “Not acceptable” status (below) to the JS tracker. Odd? or normal?

A search of this forum and the broader web did not turn up useful help on this problem.

Below, I have included

  • the link to the PDF file in the html code seen by FF, with piwik_download CSS class
  • the FF debugger’s net log entry for the URL sent to matomo.php, for the original PDF request (Status 406)
  • the FF debugger net log entry for the URL sent to matomo.php, for what appears to be a ping that follows (Status 204) (two seen)
  • My JS tracker code as received by FF

Your suggestions and further questions are appreciated.

Brett

PDF file link, with added Matomo tracking CSS style:

< a class="piwik_download" href="[https://centretownbuzz.com/wp-content/uploads/2020/04/Buzz_April_2020_Final.pdf](view-source:https://centretownbuzz.com/wp-content/uploads/2020/04/Buzz_April_2020_Final.pdf)" target="_blank" rel="noopener">Buzz_April_2020</a> Status 406 response to JS tracker sending download link (split for readability): https://matomo.centretownbuzz.com/matomo.php ?download=https%3A%2F%2Fcentretownbuzz.com%2Fwp-content%2Fuploads%2F2020%2F04%2FBuzz_April_2020_Final.pdf& idsite=1& rec=1& r=324270& h=0& m=6& s=0& url=https%3A%2F%2Fcentretownbuzz.com%2F2020%2F04%2F17%2Fread-the-april-centretown-buzz%2F& urlref=https%3A%2F%2Fcentretownbuzz.com%2F& _id=ba45f85071e4a890&_idts=1587419380& _idvc=2& _idn=0& _refts=0& _viewts=1587424908& send_image=0& cookie=1& res=2560x675& pv_id=bbskTH Status 204 (two recorded): https ://matomo.centretownbuzz.com/matomo.php ?ping=1& idsite=1& rec=1& r=058477& h=0& m=6& s=29& url=https%3A%2F%2Fcentretownbuzz.com%2F2020%2F04%2F17%2Fread-the-april-centretown-buzz%2F& urlref=https%3A%2F%2Fcentretownbuzz.com%2F& _id=ba45f85071e4a890& _idts=1587419380& _idvc=2& _idn=0& _refts=0& _viewts=1587424908& send_image=0& cookie=1& res=2560x675& pv_id=bbskTH

JS tracker, sent at end of HEAD:

< script type=“text/javascript”> var _paq = window._paq || []; /* tracker methods like “setCustomDimension” should be called before “trackPageView” / _paq.push([“setCookieDomain”, ".CentretownBuzz.com"]); _paq.push([‘setCampaignNameKey’, ‘cxn’]); _paq.push([‘setCampaignKeywordKey’, ‘cxk’]); // enable the use of navigator.sendBeacon() _paq.push([‘alwaysUseSendBeacon’]); // accurately measure the time spent on the last pageview of a visit _paq.push([‘enableHeartBeatTimer’]); _paq.push([‘trackPageView’]); _paq.push([‘enableLinkTracking’]); (function() { var u="//matomo.centretownbuzz.com/"; _paq.push([‘setTrackerUrl’, u+‘matomo.php’]); _paq.push([‘setSiteId’, ‘1’]); 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+‘matomo.js’; s.parentNode.insertBefore(g,s); })();

END

Từ khóa » H0&m