CrowdPower
  • 👋Introduction
  • ✅Getting Started
    • The Basics
    • JavaScript Tag
      • Identify Customer
      • Create Customer Event
      • Create Customer Charge
      • Create Customer Tag
      • Create Page View
      • Prompt for Push
    • Beacon API
      • Identify Customer
      • Create Customer Event
      • Create Customer Charge
      • Create Customer Tag
      • Track
    • Importing Customers
    • Basic Email Setup
    • Advanced Email Setup
  • 📚Resources
    • Smart Sending
    • Working with Sessions
    • Working with Traits
    • Working with Phone Numbers
    • Personalizing Messages
    • Push Notifications
    • Unsubscribe Groups
  • 🔌Integrations
    • Discord
    • Slack
    • Stripe
    • Zapier
  • REST API
  • Console
Powered by GitBook
On this page

Was this helpful?

  1. Getting Started
  2. JavaScript Tag

Prompt for Push

Request to send web push notifications to the authenticated user.

PreviousCreate Page ViewNextBeacon API

Last updated 3 years ago

Was this helpful?

In order to send browser-based push notifications to your customers, you will need to request permission to do so. This command will display a system prompt for the user to grant access. You will also need to have the CrowdPower file installed in the root of your website.

<script>
  window.cp('push');
</script>

Before requesting for permission to send push notifications, you must install the CrowdPower Service Worker in the root of your website; typically the /public directory.

✅
service-worker.js
Download Service Worker