HTTPS/SSL on Heroku with Google Domains as DNS provider

This might be a bit of a niche share but it is something I struggled with recently. I have a Node.js application hosted on Heroku that I wanted deployed to https://www.mydomain.com
. I bought my domain name through Google Domains as the DNS provider.
This means that even if the user puts in http://mydomain.com
or http://www.mydomain.com
it all needs to end up on…