OneSignal

No results

Help CenterGetting StartedSetting up OneSignal for Web Push Notifications

Setting up OneSignal for Web Push Notifications

Last updated April 17, 2024

Introduction: Welcome to OneSignal, your all-in-one solution for engaging your website visitors with web push notifications. With OneSignal, you can deliver timely and personalized messages to your users, driving engagement and increasing retention. In this guide, we'll walk you through the process of setting up OneSignal for web push notifications on your website.

Step-by-Step Guide:

  1. Create a OneSignal Account:
  • Visit the OneSignal website and sign up for a free account.
  • Once signed in, navigate to the Dashboard to begin the setup process.
  1. Add Your Website to OneSignal:
  • Click on the "Add a new app" button and select "Web Push" as the platform.
  • Enter your website name and URL, then click "Next."
  1. Configure Web Push Settings:
  • Follow the on-screen instructions to configure your web push settings, including selecting a default icon, customizing the prompt message, and setting up notification permissions.
  1. Install the OneSignal SDK:
  • Copy the provided JavaScript code snippet from the Dashboard.
  • Paste the code snippet into the <head> section of your website's HTML code, just before the closing </head> tag.
  1. Initialize OneSignal:
  2. Test Your Setup:
  • Visit your website in a web browser that supports web push notifications.
  • If configured correctly, you should see a prompt asking for permission to send notifications. Grant permission to proceed.
  1. Send Your First Web Push Notification:
  • Return to the OneSignal Dashboard and navigate to the "Messages" tab.
  • Click on the "New Push" button to create a new notification.
  • Customize your notification message, target audience, and delivery schedule.
  • Preview your notification and click "Send" to deliver it to your website visitors.

Conclusion: Congratulations! You've successfully set up OneSignal for web push notifications on your website. Now you can start engaging your users with targeted and timely messages to drive engagement and retention.

Was this article helpful?