How to setup Segmented Push Notifications through RSS

2020-06-26 11:08:52 UTC

Please read the basic (unsegmented) article before reading this article:

It is possible to enrich each <item> in the RSS feed with custom XML-elements that indicates that you wish to send the message to a user segment.
As the RSS specification dictates that custom elements must be defined in a XML namespace, these elements must be defined in the Visiolink-defined namespace "" (exact string). This is important, otherwise the elements will not be recognized by the parser! In our examples we use the namespace prefix "vl", however you are free to chose your own.
We recommend to declare this on the root XML element:

<rss xmlns:vl="">

Technically a user segment is a list of device tokens. However, there exists various ways to deduce such a list.
We support two (three) types of segments on an <item>:

***) Link(s) to device token list(s) on your own web server:
Technically we parse the the link contents as 1-column CSV (separator:, enclosure:" escape:\). But because at the time writing this, a device token contains no "special characters", you can treat the file as a plain text file with one line for each device token.
With this method, you can host a CSV file for each possible segment on your web server. Of course, this file does not need to be static - you can generate it dynamically. However, please be aware that for each RSS feed check, we also need to make a request for each device token list, if the message (<item>) is a candidate for being created and sent. Therefore, please keep the full request-response time down, e.g. by pre-generating the list or using a cache.
A device token list file may look like this:


It is simple to enrich a RSS <item> with a link to the token list:
<vl:deviceTokensLink type="csv">https://my.domain.tld/devicetokens/my_segment.csv</vl:deviceTokensLink>

The "type" attribute is required, and please remember the XML namespace.
We support 10 of these links, so you are able to combine (merge) segments.

You can fetch active user device tokens by integrating with Google Analytics, but this is out of scope of this article.

***) Reference to a segment defined in Google Analytics:
This works because users (with push messages enabled) in Google Analytics
(GA) are enriched with a device token. Please be aware that Visiolink needs
credentials for GA before this method works.
It is out of scope of this article how to define segments in GA, but to use
this method, you need a "view id" and optionally a "segment id" from GA.
When you have these values, you can enrich a RSS <item> with them:


We support only 1 of these references, and please remember the XML
namespace on all elements.
As the segment id is optional, you can omit the corresponding element.

***) All users pseudo segment (unsegmented):
If none of the segment XML-elements described above are present on an
<item> element, the message is treated as "unsegmented", i.e. the message
will be sent to all users!
To avoid accidents, we can enable a setting on your feed that require a
special XML-element (flag) to indicate that the message is intended as

<vl:unsegmented />

Again, please remember the XML namespace.
If this setting is enabled, and none of the mentioned XML-elements are
present, the message (<item>) will be ignored.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request