There is code so that you don’t have to specify both www and non-www versions of your domain name.
In general, if your website has domain name aliases, then there are two places to look at when configuring domains/URLs:
On the server side, the URLs you enter in the Site Manager are used in checking the referer host, so that a click from one to the other should not be treated as an external website (referer). Example: in third party shared hosting, a website may be served as either subdomain.hostingaccountdomain.tld1 or subdomain.tld2.
On the client side, the URLs you enter for setDomains() are used in checking outlinks (to determine whether or not to track the action, if link tracking is enabled), i.e., when a visitor is leaving your site.