There is a Magento 1 as well as a Magento 2 extension to add the code for you. Read about it here.