new analytics code to deal properly with the subdomains