Activating a Marfeel PWA (Progressive WebApp) to leverage the engagement and performance boosting features they provide is a simple three-step process:

Step 1

Replace the Marfeel Garda JavaScript code you inserted in your web code when you activated Marfeel, with the new snippet:


Partners on the bc.marfeelcache domain.

<script data-mrf-script="garda" data-mrf-host="bc.marfeelcache.com" src="https://bc.marfeelcache.com/statics/marfeel/gardac-sync.js" data-cfasync="false"></script> 
CODE


Partners on the b.marfeelcache domain.

<script data-mrf-script="garda" data-mrf-host="b.marfeelcache.com" src="https://b.marfeelcache.com/statics/marfeel/gardac-sync.js" data-cfasync="false"></script> 
CODE


For partners activating only our Smartphone solution will need to add an extra attribute in the script.

<script data-mrf-script="garda" data-mrf-dt="1" data-mrf-host="b.marfeelcache.com" src="https://b.marfeelcache.com/statics/marfeel/gardac-sync.js" data-cfasync="false"></script> 
CODE



Step 2

Serve the marfeel_sw.js and marfeel_sw.html files in your website's root directory. Click each file to access it. For the code needed in the marfeel_sw.html file, access its source code. 

The path of each file should resemble the following:

yourdomain.com/marfeel_sw.js
yourdomain.com/marfeel_sw.html
CODE

These are the service worker files. The location of these files is extremely important. A service worker's scope needs to be the entire domain for it to work properly. If it's placed in a scripts directory, the service worker will only be able to interact with that script directory and the ones below it. 

For more information, see the Google articles: Service Workers: an Introduction and Adding a Service Worker and Offline into your Web App.

The marfeel_sw.js file requires a very low HTTP cache header, also suggested by Google.

Marfeel strongly recommends a max-age of 3600 seconds (1 hour).

 

Step 3

Send the email address for the individual that will be managing your publication's push notifications to your Customer Success Executive.

This email contact is necessary to configure your OneSignal account. For more information regarding OneSignal, see the Push Notifications article.

If you are already using OneSignal as your push notifications provider, send your OneSignal app ID to your Customer Success Executive. For details on how to retrieve your OneSignal app ID, see the Access your OneSignal App ID article. 

Certificates

Marfeel manages the valid certificates for a publisher's users, however if the certificate provided by the origin server does not cover the request's domain (for example, www.domain.com), an error is thrown.