Web Desktop vs Web Mobile

How can I target Web Desktop vs Web Mobile Subscribers?

If you want to create mobile-web subscribers and desktop-web subscribers segments, then follow this guide.

Step 1. Add the device detection code to your pages

This little piece of code detects if the device is mobile or not, then adds the appropriate tag or a custom property.

WonderPush = window.WonderPush || [];
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
  // Store the device type in a custom property
  WonderPush.push(['setProperty', 'string_device', 'mobile']);
  // And/or store the device type as a tag
  WonderPush.push(['addTag', 'mobile']);
}else{
  // Store the device type in a custom property
  WonderPush.push(['setProperty', 'string_device', 'desktop']);
  // And/or store the device type as a tag
  WonderPush.push(['addTag', 'desktop']);
}

Step 2. Create your segments Web Desktop Subscribers and Web Mobile Subscribers

  • Using a custom property rule
  • Using a tag rule

Step 3. Use your new segments

Find your new segments in the list of segments and use them at will from push notification editor.