Google's John Mueller said on Twitter that when it comes to implementing canonical tags on your site, it is recommended to use absolute URLs instead of relative URLs. He said this will help ensure Google has interpreted them correctly.
This isn't really new news, we covered a similar topic back in 2013 when Allan Scott of Google posted on the Google blog that absolute URLs are the way to go.
In general, using either is fine with Google but sometimes going with absolute URLs can be better for Google. It depends. Absolute URLs can be a nightmare to maintain with some CMS platforms.
Here is John's tweet:
You can use either, but I'd recommend using absolute URLs so that you're sure they're interpreted correctly.
— 🍌 John 🍌 (@JohnMu) October 24, 2018
Forum discussion at Twitter.