Its better to use 301 redirection for merging your www and non-www version of your websites.
Canonical tags are required to use in cases where search engine is discovering your web pages from different path.
You wouldn’t but other people quite likely will. Since 99% of links to sites are built by people other than the site owner and you don’t have any control over how they do the link you will likely end up with perhaps 20-25% of the links to your page using the one you didn’t choose simply because some people always include the www and some people always leave it out regardless of what the site they are linking to uses.
At most you will build a few thousand links to your page but if your page is to be popular it will need millions of links to it - hence 99%+ of the links to your page will have to be created by other people.
Zorro D is absolutely correct: instead of relying on an invalid, proprietary google-only attribute in your markup, make your server redirect with a 301… search engines (and hopefully those linking to you) will update their indices.
Even if you have a 301 redirect, it’s still not a bad idea to include a canonical meta tag on large sites… just to be extra careful you don’t have any pages displaying the same content under different URLs.
i think with www is preferable…but it does,not affect more in any way so its your choice to go either way…but make sure that you use only one URL for your website with or without www
That depends on the setup of your site. Sometimes you can end up with multiple variations of an address, eg if you use dynamic URLs, and then a canonical is a very handy way to guide Google. And even if that isn’t the case, belt and braces never hurts!