SDK Client
Our scripts expose SDK Client via `ppg.client` variable
PushPushGo Scripts expose a powerful SDK Client
that allows you to customize the behavior and flow of notifications on your website. This guide will walk you through setup, registration, beacon usage, and subscription management using the SDK client.
Overview
The ppg.client
object becomes available when the SDK Client is enabled and properly integrated. It provides functionality to:
Register and unregister subscriptions
Send custom data using beacons
This allows for advanced, programmatic control over how you interact with subscribers and track user behavior or actions.
Setup
Integrate PushPushGo scripts into your website.
Go to your PushPushGo Project Settings.
Toggle "SDK Client" to the enabled state.
Navigate to your website and open the browser console.
You should now see the
ppg.client
object available globally:
Basic Usage
Registering a Subscription
Use the register()
method to create or retrieve a current subscription:
Working with Beacons
The SDK client allows you to send custom data through beacons—small, structured payloads that track events or attributes.
Using the Beacon Builder
You can send a beacon using a fluent builder interface:
Using a Beacon Object Directly
Alternatively, you can build a beacon manually and send it:
Unsubscribing a Subscriber
To remove a subscriber from your notification list:
Summary
With PushPushGo's SDK Client, you gain fine-grained control over your web push notification subscriptions and event tracking. Use it to:
Seamlessly manage subscription lifecycles
Attach meaningful labels and data to subscriber actions
Integrate custom tracking and analytics via beacons
For more information, consult your project settings or contact PushPushGo support.
Last updated
Was this helpful?