@zawadzinski opened this issue on March 13th 2008

Now you can specify in javascript code before including piwik.js your site domain aliases:

piwik_hosts_alias = [ "hostname1.com", "hostname2.com", ... ];

For some site configurations we need to support wildcards so you can specify hostname like:

*.hostname.com Keywords: piwik.js

@robocoder commented on January 12th 2009

Attachment: proposed patch wildcard.diff

@robocoder commented on January 14th 2009

Attachment: wildcard.2.diff

@anonymous-piwik-user commented on July 31st 2008

This feature is a must have for our community sites.

Each of our members have their own url (eg. kofl.devcon5.cc), so without wildcard support piwik would not be useable for us.

We hope the feature will be implemnted soon.

@robocoder commented on January 12th 2009

In my patch (which doesn't use regular expressions), wildcards are specified in a separate variable.

Usage example:

piwik_hosts_alias = [ "example.com" ]; /* matches only example.com / piwik_wildcard_hosts_alias = [ ".example.com" ]; / matches *.example.com but not example.com */

@mattab commented on January 14th 2009

Anthon, thanks for your patch. we would like to minimize complexity and no of variables involved. I suggest that we don't use regular expressions, but that the user can specify the domains in the same array piwik_hosts_alias with the notation *.domain.com

In the JS, you could look for the character * using substring and apply the same algorithm found in your patch.

Also, we have this test folder: https://github.com/piwik/piwik/blob/master/misc/testJavascriptTracker that we use for testing the javascript tracking code. Could you please add a test case?

@robocoder commented on January 14th 2009

Attachment includes tests added to page2.php, and rolls-up the piwik.js patches from #141 (revised per matt's comments), #248, and #351.

@mattab commented on February 11th 2009

thanks for patch vipsoft; see [887]

I updated documentation in the javascript tracking page; please let me know if this is accurate.

Consider a host an alias host and not record the links to this domain as outlinks

By default all links to domains other than the current domain are considered outlinks. If you have multiple domains and dont want to consider links to these websites as outlinks you can add this new JavaScript variable. There is a support for wildcard, if you want to ignore all clicks to subdomains of a specific domain.

[...] piwik_url = http://yourwebsite/piwik/piwik.php; piwik_hosts_alias = "hostname2.com"; // the current tracked website is added to this array anyway piwik_log(piwik_action_name, piwik_idsite, piwik_url); [...]

@robocoder commented on February 11th 2009

Wiki docs update looks good.

This issue was closed on February 11th 2009
Powered by GitHub Issue Mirror