Piwik and HostGator

Hi i have a feeling there is an issue with the posix path name on the JS code.

can you post a copy of the code(hiding any specific domain name) for me to look at?

in a browser can you see either domain when you enter it? I want to see when you enter either URL is there an error screen or do you see actual pages?

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.

Not sure why they do it like that but they do.

Anyone?

Send me a PM with your piwik URL, main site URL, the piwik login/pwd, and bug description. Thanks

Having exact same issue. Any resolution?

@James, are you at hostgator? try this: http://www.iwebdigest.com/176/setup/piwik-not-tracking/

Hi, I think I solved this, at least for me. I’m using hostgator and an addon domain

I was using the path of www.example.something.com instead of my real site url www.something.com in piwik as per the instructions above, but this suddenly stopped working and this is what I did:

Go to your cpanel and click add on domains.

then add a redirect so that that www.example.something.com or whatever, redirects to the actual url, eg www.something.com

Then change your piwik tracking code to now use www.something.com

and it should work!

Hope that helps!

stormjewel -

I was having same problem and tried your steps and now it is working fine. Thank you very much for your post.

jeremy

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 :slight_smile:

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!

How to - Analytics Platform - Matomo

------------------------ ALSO:
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!


NOT:
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:
Alternately, if your Piwik is hosted on the same domain as your website being tracked, you can edit your Piwik Javascript Tracking code to force data to be sent in POST, to avoid the mod_security check. Before the line piwikTracker.trackPageView(); you can add the following line piwikTracker.setRequestMethod(‘POST’);

.
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://[b]addondomain[/b].com/ (As an Addon Domain Name)
http://[b]addondomain[/b].com.primarydomain.com/ (As a Subdomain Name)
http://primarydomain.com/[b]addondomain[/b].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.
[/quote]

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.

plz guide me on this problem.

Check that you have the correct permissions in your piwik installation.

Hi everyone and thanks in advance for any help.

I also have a babycroc shared account.

I got past the mod_sec problem and got the “addondomain.com” working.

Now my problem is I cannot get “subdomain.addondomain.com” working.

How do I get over this hurdle please?

Thanks.

[b]I had the same problem with Hostgator and finally got a reply for my ticket.

Now the installation works … so maybe this would be useful for someone coming after me. :wink:

Here is the email I got:[/b]

Hello,

Upon further inspection, it was not mod_security that was preventing this from working. It’s Bulletproof Security for Wordpress, which attempts to accomplish much of the same stuff that mod_security does anyway. This plugin created a rather convoluted .htaccess configuration, but I was able to make a small adjustment to sort of “whitelist” your piwik installation.

Piwik installed in analytics/ – ticket DAE-26477979

RewriteCond %{REQUEST_URI} ^/analytics/ [NC]
RewriteRule . - [S=13]

Now I’m not familiar enough with this plugin to say for sure if it’s just going to overwrite my changes, so the plugin might clobber my changes unexpectedly. If it does, you might consider just disabling the plugin and/or removing its .htaccess rules – the things that it protects against are generally already implemented by mod_security anyway.

Let us know if you require any further assistance and we’ll be glad to help.

Cheers,

Andrew T. H.
Linux Systems Administrator II
HostGator.com LLC