FAQ

Frequently Asked Questions about Website Integration.

I already have another service worker. Can I integrate with PushPushGo?

Yes, but since there is only one service worker allowed per domain, you need either:

  • join both service workers together using importScript:

importScripts('
https://cdn.pushpushgo.com/63c574dd030eb6beb6d2c097/worker.js
')
  • or put them separately and point where the service worker from PushPushGo app is located (on your site) by providing its path and typing ‘/ppg_scope’ in service worker scope in project settings:

Is it possible to integrate Progressive Web Application (PWA) with PushPushGo?

Yes, but since PWA will always have its own service worker and there is only one service worker allowed, you need to use one of the solutions from question above "I already have another service worker. Can I integrate with PushPushGo?".

Is it possible to integrate my website via Google Tag Manager (GTM)?

Yes, you can integrate your website via GTM, but only basic integration will be possible, since you do not have access to the server root path.

Go to your Google Tag Manager and then:

  1. Create a new tag. Select the “Custom html” type and paste the code from the Integration > Installation tab.

  2. Open “Advanced settings” and enter “1” in “Tag firing priority”.

  3. Set the trigger to “DOM Ready”.

  4. Remember to publish changes.

I have changed the service worker name but integration is not working. Why?

If you want to change the service worker name, for example from ‘sw.js’ to ‘service-worker.js’:

I have changed the directory where sw.js file is located but integration is not working. Why?

If you want to change the directory where the sw.js file is located (for example, to ‘static/sw.js’):

  • save service worker path in project settings as ‘/static/sw.js’ and service worker scope as ‘/static/’.

Remember - after setting scope different than ‘/’ (global), eg. ‘/static’, our application will work only on subpages in that scope or below, so:

  • https://example.com/static - code will work here

  • https://example.com/static/page1 - code will work here

  • https://example.com/ - code won't work here

  • https://example.com/cart - code won't work here

If you still want our code to work globally in that case, you have to set scope as default - ‘/’ and add the following response header: "Service-Worker-Allowed": "/" to subpage containing service worker.

I want to integrate one project for each subdirectory of my website. How should I do it?

You need to integrate each project by placing the integration script in the corresponding website subdirectory source code and service worker in the subdirectory folder of the server.

Then, change the service worker path & scope of every project in project settings accordingly. For example, for ‘your-site.com/en’ change service worker path to ‘/en/sw.js’ and service worker scope to ‘/en/’, and for ‘your-site.com/de’, change service worker path to ‘/de/sw.js’ and service worker scope to ‘/de/’.

Sometimes when there is no possibility to add more than one worker, you can try importing subdomains’ service workers into main service worker and write logic to use them conditionally.

Last updated