top of page

Install 360X Web Push SDK in Website

  • Writer: Naveen VM
    Naveen VM
  • May 20
  • 2 min read

Here’s a step-by-step guide to install the 360X Web Push SDK on your website and integrate it with Salesforce Marketing Cloud (SFMC):


ree

  • Get the Required SDK Files

    • Email Request: Send a request to support@message360x.com to obtain the 360X Web Push SDK.

    • Receive ZIP: You'll get a .zip file containing the necessary SDK files.


  • Unzip & Prepare the Files

    • Extract the .zip file.

    • After the extract, you will find two files (screenshot below):

      • sw.js – handles background push notifications.

      • pusher.js  – manages registration permission prompts, and customer ID updates.


360X Web Push files

  • Host the Files on Your Server

  • Add pusher.js to Your Website

    Choose one of the following options:


    Option A: Inline Script

    Copy the pusher.js file code and add it directly in the <head> tag.

<head>
  <script>
    // Paste the full contents of pusher.js here
  </script>
</head>

Option B: External Script

Host the pusher.js file code in the CMS or the root folder and add the file location in the <head> tag

<head>
  <script src="https://yourdomain.com/scripts/pusher.js"></script>
</head>

  • Update Service Worker Path in pusher.js

    • Inside pusher.js file, update the service worker registration path to point to your hosted sw.js file:

navigator.serviceWorker.register('https://yourdomain.com/scripts/sw.js');
  • Capture Customer Email or ID (If Logged In)

    • If the customer is logged in, you should pass a unique customer identifier (email, contact ID, or customer ID) to the 360X SDK to associate the device with a known profile in Salesforce Marketing Cloud.


      Use the following method:

update360xWebPushCustomerId(customerId)

Example:

update360xWebPushCustomerId('john.doe@example.com')
  • This ensures that anonymous visitors become known users, allowing their data to sync with SFMC.


That’s All from the Website End!


Once the above steps are implemented:

  • The user will be prompted to allow push notifications.

  • Their push token and customer ID (if provided) will be sent to 360X Web Push and integrated with Salesforce Marketing Cloud.

Comments


bottom of page