Migrating to a new domain name, host name or site URL.
Web push notifications are tied to a host name. The push notification permission for www.example.com
is not valid for shop.example.com
or www.anotherexample.com
. When users receive push notifications, the host name is displayed directly on the push notification:
It's quite common for websites to change the host name or domain name part of their URL. If you have to go through such a change, you will need to update your WonderPush setup. This guide describes what to do and what to expect.
Step 1. Host WonderPush SDK files on the new host name
If your push notification domain is a subdomain of
by.wonderpush.com
skip directly to step 3.
-
Download wonderpush-sdk-files.zip
-
Unzip the archive and upload its content to the top-level root of your website directory to make it publicly accessible under your new host name.
Once you've uploaded both files, the following URLs should be publicly accessible (replace newhostname.com
with your new host name):
https://newhostname.com/wonderpush.min.html
https://newhostname.com/wonderpush-worker-loader.min.js
If you cannot upload SDK files in the root directory, you have the option to put them in a subdirectory. Go to Settings / Setup Web Push notifications , hit save and fill the following form:
Step 2. Update your host name in the WonderPush settings
Go to Settings / Setup Web Push notifications and update the Site URL to reflect your new host name:
Hit save.
Step 3. Copy code
Make sure all pages of your new website contain the code snippet featured on the next page:
That's it!
You can now start the process of changing your hostname.
What happens to previously subscribed users?
Upon making the above changes, your number of subscribers will stay unchanged.
Users who've previously signed up will continue to receive push notifications from your previous host name. When they hit your new website URL, WonderPush will ask them to sign up again. Two things can happen:
- If they sign to the new host name, they will start receiving notifications from the new host name and stop receiving notifications from the old host name,
- if they don't sign up, they'll keep on receiving notifications from the old host name
Users who had previously subscribed and unsubscribed from the previous host name will be asked to sign up again when they visit the new host name. If they do, they'll start receiving push notifications again, from the new host name.
Upon receiving a notification, users subscribed to the old domain will notice that the domain has changed and signal themselves as having potentially migrated. Our servers will afterward unsubscribe these users from the old domain. This means that it's expected that migrated users will likely see a duplicated notification before the server-side migration process takes place.
Users who hadn't previously subscribed won't notice a thing.
Updated over 2 years ago