If you are using PushAssist Magento extension, you don't have to add any JS code within your store since the extension installs it automatically for you.
If you run or own a Magento powered store you can simply install the PushAssist Magento extension for push notifications from Magentoconnect which will handle everything for you. It works well for all
Magento 1.9.x and below community editions. It should also work on Magento EE. Magento 2 extension is coming soon.
You have an option to change the opt-in dialog text, message, logo image etc. from your PushAssist control panel to make it more personalized.