Example – If the URL contains turmeric, then add to segment Turmeric like this –
Here is our step by step GTM guide to fire PushEngage tags/API
Example: If the URL contains Features and is a page that is in a subdirectory below features, we will add the segment Features to the web push subscriber.
- Create a New Trigger -> Features URL Trigger in GTM
- Configure the Page URL pattern using RegEx, or any other mechanism.
- On this Trigger fire a Custom Tag, which has Push Engage code.
Note, please ensure we are firing the correct version of PushEngage JS API. If you have added PushEngage using Legacy code, then use Legacy API. If you have added Push Engage using the Asynchronous code, then use that API.
For Async code, the call to add to segment is window._peq.push(['add-to-segment','segmentName']);
See how to add this code in GTM
That’s all. Now all you’re your subscribers will be segmented based on their browsing patterns. You can then send a relevant notification based on their geolocation, device-browser used during the subscription or the date range.
Once you have segmented your push subscribers, you can even start the different trigger push notification campaigns for different segments.