I tried to follow the instructions to set up Piwik with HostGator found here: http://www.warriorforum.com/adsense-ppc-seo-discussion-forum/374809-anyone-successfully-installed-wp-piwik.html
Following the instrucitons in the post from "east_coast_alex", I set it all up the way he detailed, with no problems except a "404 mod_security" warning at the beginning which "east_coast_alex" has a work around for (via the Piwik troubleshooting).
I set up everything and for some reason, it isn't tracking visits. I base this on the fact that I've been clicking around my website and Piwik hasn't recorded any visits. Any ideas?
I did this and they wanted me to go through a lengthy process to do it. Considering that I am going to be using Piwik for many of my clients (hopefully) and I don't have access to all of their hosting information, I would like help on a work around instead of going through HostGator.
I tested two domains. One it works just fine for and the other, it won't work at all. The only difference I can see is that the domain it does work for is the main domain on my shared hosting program and the other domain that isn't working is just a subdomain technically.
Would this make a big enough difference to mess up Piwik?
I have two websites: website 1 and website 2. Website 1 is working just fine. Metrics all working, etc. Website 2 is not working at all. No metrics, period.
Neither website is whitelisted by HostGator. Both websites were set up the exact same way, with the exact same code (I rechecked it again just to make sure) except, of course, with differences in the website addresses where applicable. The only difference between these two websites is website 1 is my main domain for my "Baby Plan" at HostGator and website 2 is an "add on" domain. Would this break everything down?
I would rather not list the domain names as one is a customer's and non disclosure is a part of my policy.
Thanks for your help on this issue though and I will try to be as transparent as possible with the rest of the information.
I have two different piwik installations for the two websites. One is not feeding off of the other. I did this because if someone (maybe even Google) were to take a look at the source file or spider it, they could make connections between websites that don't need to be connected. For instance, two different clients who have no common link except that I handle their website needs.
I am confused on the second question but it is an add on domain as in the first website is the website I signed up with for HostGator. When I acquired the second website, I went in under CPanel and clicked "add on" domain and added it.
I don't understand why the workaround works for the main domain but not the add on domain.
I've tried twice with HostGator to get them to whitelist the mod_security but they tell me there's nothing mod_security is blocking for them to whitelist. How did you get them to whitelist you?
I am not a total webmaster, even on a good day haha so I will try to reply the best I can.
The piwik install is on the same level for both domain names. I just went to the file manager and clicked on the individual site. It took me to the files for that particular website and I just uploaded the piwik and installed.
Do you think I may need to list the add on website as ftp.mainwebsite.com in Piwik, if that makes sense? I know HostGator actually makes the addon a subdomain of the main domain. Do I need to reflect that in the script? So instead of www.addonwebsite.com it needs to be <ftp for addonwebsite>.mainwebsite.com?
ok you mention the domain so that it looks like its a sub domain and not a add on domain.
ftp.mydomaiin.com is a sub domain of mydomain.com
An add on domain would be a different domain name like mydomain2.com
The problem may then be piwik may have a problem as the location of teh sub domains folder is different than the main domains folder so definitely check the paths structure in the php files.
Normally a subdomain i would think if the js script is the same would end up being put into the data of the main piwik install. I think since this is a sub domain the whitelisting is the way they allow a sub domain to be separated and report like a seperate true domain.
If you are looking at providing a service of tracking various sites would it not be an option to have your one domain to host piwik. Create separate JS code for each site that would be placed on all the various sites and mange it from one piwik install?
Since the code is custom per site the domains would have not real relation that google would group to.
Even if you begin to host various web sites via cpanel since they are separate domains that scenario would work.
just putting options out there as since you specify a subdomain as part of your URL then it will be grouped in a sense by google to your main domain.
As I understand it in HostGator, an add on domain is actually just a subdomain of your main domain name. Whatever the reality is, it is definitely an add on domain that I am working with.
The reason I don't manage all of Piwik from my main domain is because if you do this, any tracking code you generate will have the main domain as a part of the tracking code. Another issue I hadn't though of is my clients will want to login to their Piwik to see their stats as well. It's much more branded if it's already on their specific domain, if that makes sense.
For my particular site, since it isn't the main domain, am I going to need to specify the true server path as the domain name instead?
I am going to write this for any future people with the same problem.
HostGator allows you to add on multiple domains (these are called "add on domains" so that you can have as many domains as you want on one account. This is a pretty great feature but there is one issue to be aware of: when you add on a domain, it technically becomes a subdomain of the main domain that you first signed up for your hosting account.
Let's say when you first signed up for HostGator you singed up your main domain: "www.maindomain.com". Then, you decided to host a few other sites through your hosting program by using the "add on domain" feature. So, you added a new site caled "www.newdomain.com". www.newdomain.com is technically a SUBDOMAIN of www.maindomain.com. Considering this, Piwik won't take www.newdomain.com in the tracking code. Piwik wants the actual subdomain path you set up for your add on domain. It is easy to find this. If you click on "File Manager" in your CPanel, you will see many domain names and subdomains for you to choose from. One of those subdomains is the one you want, you just have to remember which one it is. You set up this subdomain when you went through the add on domain process. Once you remember the correct subdomain, you need to use the full subdomain in the Piwik tracking code instead of the main domain.
Is there any way to circumnavigate having to use the subdomain? It still points to the primary domain in the source code and connects websites that shouldn't be connected. This may sound strange but I peruse the source code of competing websites all the time. I don't want anyone looking through one of my sites to see it connected to another site because it's an add on domain.
Is there another way to enable Piwik to use the "true" domain name for an add on domain?
Since you are hosting a domain as long as your piwik JS code is different for the new domains you should be fine. when you host multiple domains via a source like hostgator you will be using virtual hosts. The only thing that really would tie your multiple sites is the common DNS settings if someone were to pull that. (typically IP address and the name servers)
would otherwise appear differently for all intensive purposes
Unfortunately, Piwik won't allow me to use my full add on domain in the code. It won't work.
For example, let's say my add on domain is www.addondomain.com. I can't use www.addondomain.com. I've tried and the data just sits at zero and nothing happens. However, if I use the subdomain that my add on domain is registered under HostGator with, it works. This does tie me to another website because the subdomain is an extension of the primary domain. So, the website I have to enter into the code is addondomain.primarydomain.com.
This can be seen in the source code and ties me to my primary website.
I have a shared hosting plan with HostGator. The shared hosting plan allows me to have a "primary domain" and then I can have as many other domains on the shared hosting I want via the "add on domain" function. How this basically works is they configure my "add on domain" as a subdomain to the "primary domain".
How this appears to the average user:
Primary domain url: www.primarydomain.com
Add on domain url: www.addondomain1.com
How this works technically with HostGator:
Primary domain url: www.primarydomain.com
Add on domain url: www.addondomain1.primarydomain.com
Although you can access the "add on domain" just by going to "www.addondomain1.com" it is actually set up as a subdomain and it's REAL pathway is "www.addondomain1.primarydomain.com".
Unfortunately, Piwik won't accept "www.addondomain1.com" in the script. It won't work. You have to use the REAL pathway: "www.addondomain1.primarydomain.com". This is unfortunate for someone in my case because I have a client set up as the primary domain and another, separate client set up as the add on domain. For Piwik to work on the add on domain, I have to use the "www.addondomain1.primarydomain.com" in the script. This associates two websites that I don't want to be associated at all. I do a page source look up all the time on sites and I don't want others doing that and associating two websites together that aren't associated at all except that they're both my clients.
How can I set up Piwik so that it recognizes the add on domain without having to associate it with the primary domain in the script?
You would think just "www.addondomain1.com" would work but it does not.
It will only take take the "www.addondomain1.primarydomain.com". I have tested and can confirm this. Does anyone know a way around this? By either changing some HostGator functionality or Piwik functionality?
Actual pages. The way HostGator sets it up it seems like a normal hosted domain. However, their backend process is to make an "add on domain" actually a subdomain of the "primary domain" of the account.
This all seems really weird to me, because I never needed to jump through the hoops you all listed here to get my Hostgator account to work with an add-on domain. Just set up the add-on domain (not the subdomain), never needed to use the redirects. I had two different Piwik installs in the same account (not subdomains of my main domain), and it all worked just fine after I had them whitelist the install domains.
My only problem being on Hostgator was the resource limits for PHP once my installs started collecting a lot of data, so I had to move them after that anyway
Also, the way Hostgator sets up what they call add-on domains is something a lot of places use for their shared hosting setups, seemingly everyone who uses cPanel for their customers. Media Temple does something similar on their (gs) service, where each additional domain is in its own folder, but there aren't two different names for that domain setup.
Hey setup piwik according to the following link and no domains are connected at all and you control ALL domains in ONE install and it even HIDES your installation!
I am on hostgator and I gave up trying to get it whitelisted and just changed the code per the troubleshooting to use post instead of get and works fine!
If your host uses mod_security to block requests containing URLs (eg. hosts like HostGator, The Planet), you should contact your provider to whitelist your domain (or URL) and disable mod_security for your website.
THIS works no problem:
Edited 1 time(s). Last edit at 01/26/2013 03:27PM by dumtdump.
About the problem above of hostgator and the "addon domains":
copy/paste from hostgator support:
Please read before creating an Addon Domain
About addon domains
Addon Domains are handled like subdomains as far as the server is concerned, but to the outside world they are separate domains.
Addon Domains do not have their own cPanel; however, you may still create e-mail accounts, redirects, Fantastico installations, subdomains, etc.
Web stats for your Addon Domain will be found within the icon of the web stat program you select in cPanel. If you are using an older cPanel theme such as "X", you will need to look under Subdomain Stats to find the web stats.
Every addon domain is also a subdomain. You may actually load your addon domain in one of three ways:
http://addondomain.com/ (As an Addon Domain Name)
http://addondomain.com.primarydomain.com/ (As a Subdomain Name)
http://primarydomain.com/addondomain.com/ (As a subfolder)
Don't worry! Visitors will only know the link you give them; they have no way of knowing which domain is your primary domain and which is the addon domain. To your visitors, the Addon Domain appears to have its own hosting plan.
i'm facing same issue
i moved to hostgator, and their is no tracking.
just came to know that access to piwik/piwik.php is blocked
means that piwik/piwik.php is giving me 500 Error
but piwik/piwik.js is working fine.