LogoLogo
Sign inSign up
  • PushPushGo Documentation
  • Web push
    • Overview
    • Instructions
      • Subscription tests
    • Service worker
      • Subdomains / Wildcards
    • Integration script
      • Subscription form
        • Subscription form creator
          • Topics
        • Subscription form delay
        • Display form rules
        • Confirmation window
      • Bell widget
        • Inbox
        • Topics
      • Google Analytics & Google Tag Manager
      • Default notification
      • Beacons
      • Security SRI / CSP
    • SDK Client
      • Legacy SDK (deprecated)
        • Examples
    • JS Code
    • Safari support
    • FAQ
  • Mobile push
    • Overview
    • Google Android
    • Apple iOS
    • Huawei Android
  • ONSITE NOTIFICATIONS
    • Overview
  • Onsite notifications
    • Create onsite notification
    • Edit onsite notification
    • Onsite notification report
    • Inbox
  • Onsite notifications list
  • WHATSAPP CHANNELS
    • Overview
  • Whatsapp channel
    • Create a channel
    • Subscribers
    • Create a WhatsApp message
  • Subscribers
    • Subscribers
      • Activity status
      • Subscriber Details
    • Labels
      • System Labels
      • Add Labels Manually
    • Segments
      • Create Segment
      • Copy Segment
      • Update Segment
      • Delete Segment
    • Geolocation
  • Campaigns
    • Campaigns
    • Push campaign
      • Create Campaign
        • Content
        • Audience
          • By Segment
          • By Labels
        • Provider options
        • Time
        • Drafts
      • Campaign List
        • Cancel Campaign
        • Copy Campaign
        • Copying and pasting campaigns between projects
        • Delete Campaign
      • Campaign Report
    • AB test
      • Create AB test
        • Variants
        • Audience
        • Provider options
        • Time
        • Save draft or accept a test
      • AB test list
      • Winner selection
      • AB test report
      • Cancel AB Test
      • Send AB test saved as draft
      • Resend AB test
      • Delete AB test
    • RSS campaign
      • Create RSS campaign
      • Audience
      • Enable RSS campaign
      • RSS campaign report
    • Chrome plugin for Rocket push
    • Multi Push
    • Daily push capping
    • Planner
    • FAQ
  • Automation
    • Overview
    • Automation
      • Create automation
        • Name
        • Flow
        • Renew flow
        • Start date
        • End date
        • Building the flow
        • Step
          • Trigger
          • Campaign
            • Create campaign
            • Edit campaign
            • Campaign templates
      • Edit automation
        • Update automation
      • Report
        • Automation report
        • Campaign report
    • Automation list
      • Prority
      • Action
      • Status
      • Reset flow time
  • Analytics
    • Project analytics
      • Subscribers
      • Campaigns
      • Automation
    • Organization analytics
      • Organization dashboard
        • Subscribers
        • Campaigns
        • Automation
      • Project comparison
    • Exports
  • Integrations
    • Webhooks
    • REST API Reference
  • Release notes
Powered by GitBook
On this page
  • Add customId to your subscribers
  • Fetch subscriber ID after register
  • Switch for subscribe action instead of popup

Was this helpful?

  1. Web push

JS Code

Integration code callbacks and hacks

Add customId to your subscribers

Add the code below to your HTML DOM Tree

<var id="ppg-custom-id" data-id="your id here"></var>

Fetch subscriber ID after register

Our standard integration code allows to register callback for syncId event.

When subscribers "subscribe" you can receive ID without usage of our SDK

<script>
window.ppg = window.ppg || {};
window.ppg.register = window.ppg.register || [];
window.ppg.register.push(['syncId', subscriberId => console.log("Your SubscriberID:", subscriberId)]);
</script>

Switch for subscribe action instead of popup

It's possible to do that just add <input> with type checkbox and id="ppg-switch".

<input type="checkbox" id="ppg-switch" disabled="disabled"/>

You can hide popup by setting "delay popup time" to 999999s

Example code of toggle usage with styles you can see at: https://github.com/ppgco/examples/tree/master/sdk_toggle

Last updated 4 months ago

Was this helpful?