JS Code

Integration code callbacks and hacks

Add customId to your subscribers

Add into 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 reveice 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