Subscribe users in independent WordPress pages and send notifications (segments isn't working)

Hi, I was recently adding webpushr to a WordPress site and I’m trying to subscribe users on two different pages (Page A and Page B) I made the manual integration by adding a different WebPushR code on each page, but when a user get subscribe in Page A and I navigate to Page B I noted the user got to subscribe to Page B too. How can we separate user subscriptions on my site? And how can we send independent notifications when Page A is updated and when Page B is updated.

I also added a line of code to the page to add a custom attribute to the user to segment them but it looks like the user is not getting the attribute as expected.

Hi there,

Thank you for using Webpushr.

You cannot use two different Webpushr codes (with 2 different public keys) on the same domain. If you do, you will run into what you described: the same user gets subscribed repeatedly on both pages.

Please use one public key/code-snippet per domain.

You can use our Custom Attribute feature to tag subscribers any way you want. There can be some limitations of using this in your use case that are explained in detail in our documentation for Custom Attributes. You will need to test this out on your end.

Let us know if the API is not behaving as expected/documented.

1 Like

Hi, Thank you for your help. As you mentioned that was the problem.

Now, the thing is that if a user subscribes to page A and navigates to page B it appears as subscribe on that page too but will not receive notification about changes on page B unless the user navigates to that page (page B) using other browsers and subscribe.

I wonder if that’s the way this actually works or there is a solution to allow the user to subscribe to two different pages and receive notifications when the page is updated.

Thanks in advance.

This will only happen if you have a different key on each page (Page A & Page B). Let’s make sure you have one public key per domain. Doing so will take you to a baseline valid integration.

Thank you for the update. One last question about this. There is no need to have segments to identify the page the user subscribed to?
Does the Webpushr integration handle this by default?

Thanks

Hi. I update my pages (Page A and Page B) with the same public key. But once I navigate to Page A and click on subscribe the bell icon appears (that´s ok)
image
but if I navigate to Page B the integration doesn´t request the user to subscribe again, it just shows the bell icon at the bottom

It looks like there is no possibility to have an independent subscription per page.
Could you please confirm?

Thanks