How to migrate multiple websites into Batch Omnichannel projects?

As part of the migration from the Batch MEP to the CEP, your mobile apps and websites need to be grouped into omnichannel projects. Since each omnichannel project can contain a maximum of 1 Android app, 1 iOS app, and 1 website, you may wonder how to configure your dashboard with multiple websites.

Here is how to set up the Batch dashboard depending on your websites' typology:

Case A: Independent websites

This case applies when you manage websites that correspond to different products (e.g., separate brands or media titles) via separate environments on the Batch MEP dashboard.

👉 In this case, simply request that our team create one omnichannel project per website. If there are corresponding mobile apps, they can be included in the respective projects.

Case B: Variants of the same website

This case applies if you manage websites for the same product via separate environments on the Batch MEP dashboard due to a difference in subdomains. The most common case corresponds to country sites managed on different domains (e.g., domain.fr, domain.it, domain.es, etc.).

👉 In this case, we will group all web domains within a single web environment, which we will call the target environment.

To do so, follow these steps:

1

Pre-requisite: Unique Custom User IDs

2

Managing web environments (Batch dashboard)

Option 1 steps:

Option 2 steps:

At this stage, your Batch contact can already create the omnichannel project including the target web environment and the corresponding mobile apps (if there are any).

3

JavaScript tag implementation

Update the Batch JavaScript tag on all your websites:

async function replaceBatchRegistrations() {
  if (!("serviceWorker" in navigator)) {
    return;
  }

  // List registered service workers
  const currentServiceWorkerRegistrations = await navigator.serviceWorker.getRegistrations();
  await currentServiceWorkerRegistrations.forEach( async (registration) => {
    if (registration.scope === 'https://www.domain.fr/') { //REPLACE WITH OLD SCOPE
      // Found old service worker -> Removing
      console.debug("Found old service worker -> Removing")
      await registration.unregister()
    } else if (registration.scope === 'https://www.domain.fr/js/') { //REPLACE WITH NEW SCOPE
      if (!("pushManager" in registration)) {
        return;
      }
   
    }
  })
}
await replaceBatchRegistrations()
4

Managing orchestrations

Last updated