Tracking Code Empty On Settings->Manage->Tracking Code

Help! I updated to 2.0.3 and it encountered 2 errors (needed to change where it was looking for the zipped update file and I can’t remember the other one), but then seemed fine.

Now there are 3 issues:

  1. The tracking code is empty on the Tracking Code section of Settings->Manage. Also, the contents of the page are all scrunched down so something is wrong!
  2. I can’t update my User Settings, I keep getting Token is not valid
  3. It’s not tracking anything


Here are some images so you can see.

Do you see a javascript error in the console? does it work with another browser eg. Firefox?

I did all of this in FF as requested.

There’s no error when I try to change my User Settings, still just getting Token is not valid.

There IS an error on the JS Tracking Code page.

I’ve attached images of both.

Go to the NET panel. Look for a request that contains “action=trackingCode”

What is the “response” for this request?

Otherwise you can also try this: After I updated Piwik, it stopped working (blank page, widgets not loading, error message, etc.). How can I fix this? - Analytics Platform - Matomo

OK, the response was massive. I copied it into a file and have attached it.

Can you PM this forum URL, the piwik URL, login and password and bug description / how to reproduce? i’ll take a look and try to reproduce / fix it!

I keep having the same problems for a very long time (~1,5 years ago after an update. Did manual copy a fresh piwik and just my config file etc. but I seem unable to fix this):

  • Can not change any settings, not even my own SuperUser-PW -> “Token is not valid”
  • If I try to add a new user (filling all fields of course) I get: “Please specify a value for ‘userLogin’.”
  • Dash Board Changes do not save -> no error message shown
  • can not add new websites (filling all fields of course!) -> “Please specify a value for ‘siteName’.”
  • Tracking Code does not show in settings etc. etc. etc.

Piwik is logging perfect and as designed, just the above stuff keeps not working and I’m going nuts about it… :slight_smile:

Any ideas?

Kind regards,

can you PM your piwik url + login + password + link to this post, I will take a look

Same here. I have sites with multiple hosts, and the problem seem to be across multiple MySQL versions with some, while not with all.

please try upgrade to 2.1 rc 301 Moved Permanently

I can confirm that this problem still exists in the 2.1 RC, for me since 2.x started. I get the EXACT same symptoms as the OP.

what php versions are you guys using? have you tried to delete tmp folder contents and check php.ini memory setting to see if a boost will help?

Any error in javascript console ?

Got this when used error console in Firefox:

Error: TypeError: elem.tagName is undefined
Source File: chrome://fdm_ffext/content/fdm_fmbtn.js
Line: 409

No change after last update to 2.1.0. Tracking code still empty.

Maybe send me PM with your piwiK + login + password?

I am afraid I have the same empty tracking code fields problem with a new install (not upgrade) of Piwik 2.1.0 (on both my dev and live sites). Both the JavaScript Tracking Code and Image Tracking Link fields are just empty s.

My hunch is that Piwik is maybe making a net connection to try to load certain files and these don’t seem to be working (see attached screenshot). I have tried to deny Files access (to “*” ), with exceptions for <Files ~ “^piwik.(js|php)|^index.php$|robots.txt$”>, to all but expected admin user computer IP addresses, and this seems to have stopped certain URIs from loading.

Sorry for the size of the image, I don’t seem to be able to widen the URL field by any means other than making the whole window wider. The URIs that don’t seem to be loading properly, and aren’t clear from the image above, (my Piwik installation is in the site root) are:


(which, if I’m reading Firebug correctly(?), seems to call the following…)


(I have replaced the id number in the URIs above with ‘id’, just in case it’s sensitive information?)

I have temporarily removed my access restrictions and now my tracking link fields have come back, but the URIs above still seem to be shown as still loading…

I’m guessing I possibly need to tweak my Deny and Allow rules further… I don’t understand what is stopping these URIs from loading on one of my admin user computers, however. Do I need to tweak my rules to allow either the IP address of the Piwik installation (or as well?

[Edit: added note that the Firebug output is for when loading the trackingCodeGenerator page.]

I have now tweaked my <Files “*”> section to once again allow only my permitted IP addresses, and to add:

Allow from

…and the tracking code fields still seem to be working

Now I also seem to see the following in the “stalled loading”(?) section of the Firebug output…


logo.svg does appear on the page, and the other 3 images appear to be ‘display:none’ (or otherwise hidden) by default, so possibly these are just red herrings…?

I’m not sure about the rest, but this is still an issue for me, five hosting packages with two different hosts. Tracking code is simply empty. Any clue?


we have some clue, actually spent few hours trying to find solution, and hopefully we got it right. The problem likely can be explained if your hosts and servers are using apache. We discussed bug in: Unicorn! · GitHub

It is fixed in the 2.3.0-rc2 release, please test it, and if you have a problem create a new post here, thanks