Integrating Batch into your website is simple. After a 20 minute setup, you will be able to push them directly from your website, without making them install your app. And just like native applications, you can send push notifications with images, and more!
1. Account Creation
You can create an account now on https://batch.com/register.
We recommend you to invite your team members from the account manager section, in the bottom left corner of your dashboard, in "Manage team" → "Invite user". Once your account is created, add your website to the dashboard.
2. Basic Setup
Step 1. Upload the service worker (optional)
If all your content is served via the same HTTPS domain, then you must upload Batch's Service Worker to the root of your website.
Step 3. Test your integration
That's it! You should see a push permission prompt next time you visit your website. We recommend you try sending a test notification to your browser after accepting push notifications. More information here: how to send a test push
In case you don't see the permission prompt, make sure:
3. Optional Optimizations
To maximise the chances that your users subscribe to notifications, we built multiple ways of asking for permission (know more here).
You can choose between three different formats:
- An alert (default)
- A banner
- A button
In case you don't want to use Batch's formats, you can trigger the native prompt of each browser. That permission request can be shown 3 times a week (more information here).
Custom User ID
Batch can collect a unique user ID (see documentation) that will be attached to your user installation. This is a recommended step if your website has a login wall or if users can create an account on your website.
You can use that Custom user ID with:
- The Transactional API, to send 1-to-1 push notifications to one or several user IDs (e.g. package delivery notification, etc) ;
- The Custom Data API, to send custom data (attributes or tags) to Batch on a user ID server-side.
User ID collection also allows your teams to:
- Target logged in / logged out users (see has custom user ID)
- Upload static segments exported from your userbase (e.g. top 500 buyers, etc) or created by third-party tools (see custom audiences)
Batch automatically detects the language and the country of your users’ browser. If users can select a region or a language from your website, we recommend you overwrite the values automatically detected by Batch (see documentation).
4. Optional APIs Setup
With Batch RESTful APIs you can easily send custom data and push notifications to take advantage of Batch’s advanced features from your own systems. There are basically three APIs you can use in your app to cover all your marketing needs:
- The Custom Data API to send custom data on specific custom user IDs and improve your campaign targetings.
- The Transactional API allows you to send notifications to a specific token or custom user ID based on events in your back-end (e.g. "You have a new friend request").
- The Campaigns API allows you to send push notifications in mass to your segments (attributes, events) or to segments generated by Batch (country/language, dormant users, app version, etc).
Depending on the use cases you plan to set up, we can help you through the use of these APIs.
Our technical team is reachable via the “live chat” in the bottom right corner of every page of the dashboard (median response time lower than 3 minutes from 9 am to 7 pm on working days).