Home / Admin / Add Subscriber to Segment
Duplicate Snippet

Embed Snippet on Your Site

Add Subscriber to Segment

This snippet helps you add the push subscriber to the segment as per the action defined.

Code Preview
js
var peSegmentNames = []; // Array of segment ids e.g, ["segment1", "segment2"]
window.PushEngage = window.PushEngage || [];
PushEngage.push(function() {
    PushEngage.addSegment(peSegmentNames).then(function(data) {
        console.log(data)
    }).catch(function error(error) {
        console.log(error.message)
    });
})

Comments

Add a Comment