How to Effectively Use Push on Your News or Media Site

You’ve already implemented OneSignal on your site and are gaining subscribers, so how can you actually use web push to grow your business?

The more a customer visits your site, the more likely they will be to engage with and share your news, thereby increasing traffic to your site. Further, the more people feel appreciated by and engaged with your site, the more they are likely to remain loyal and recommend you to others, which helps your site traffic grow. Customer re-engagement is key to any sound business strategy and web push can be a key engagement channel. Below are some examples of how you can make the most out of web push on your news or media site.

Send a message to get a previous visitor to come back to your site

Let's say a visitor comes to your site once, but hasn't returned in over a week. Follow these steps to automatically send them a reminder to encourage them to come back to your site.

Step 1. Set up your Message Template

First, let's set up the message you'll want to send a visitor to get them to come back to your site. We've prepared a default message for you below. 

  • Log into your OneSignal dashboard. 
  • Go to Messages>Templates and click on New Push Template

In the body of the message template, cut and paste the text here or customize it to your liking.

  • Template Name:

Come Back

  • Title:

You're missing out on the latest gaming news!

  • Message:

It's been a while. Stay in the know with our latest gaming news. Come check it out!

  • Image: [Upload an icon to use, or leave it blank]
  • Launch URL: [insert the URL of your website, example - http://mysite.com]
  • Click SAVE

Step 2. Set up an Automated Message

In the OneSignal Dashboard, go to Messages>Automated and click on New Automated Message and choose New Automated Push. Name your message.

Message Name: Come Back after 7 Days 

**You can name the Message anything you like, but it's always best to be descriptive.**
  • Under Audience, choose the radio option for Send to Particular Segment
  • Under Who should receive this campaign?, click + Add Segment and select the Inactive Users Segment. Make sure to click X next to the default Segment to remove it.  
  • Under What template do you want to send, click the Dropdown arrow and choose the Template you created in Step 1 - Come Back
  • Under Deliver to users more than once?, check the box for If the user returns to the app
  • Click on Make Active.

And that’s it. Now, whenever someone visits your site but hasn't returned in 7 days, they will automatically be sent a notification asking them to come back to check your site for new updates!  Clicking on that message will take them right back to your site.  

Send News Items based on visitor interests

A best practice for news sites offering a large range of content is to allow users to choose which categories of news they'd like to receive notifications about. Follow this tutorial to do just that with our Category Slidedown Prompt.

Step 1. Configure Categories in your Slide Prompt

**This step assumes you've already set up the Slide Prompt on your website.** 

Once, you've got that working, in the OneSignal dashboard, goto Apps and click on your App. Then go to Settings and click on the Edit Icon next to All Browsers

  • Under Permission Prompt Setup, click on the Edit Icon next to Slide Prompt(Recommended)
  • Under Slidedown Prompt, enable the toggle for Categories. This will reveal the configuration options for Categories.
  • Under Tag Key, name your Data Tag and choose a label for it to display to the visitor. 
Tag Key: prefer_politics Label: Politics
  • Click on Add Category to add 2 more:
Tag Key: prefer_worldnews Label: World News Tag Key: prefer_localnews Label: Local News
  • Click Done and Save to save your configuration preferences. 

Now, whenever a visitor subscribes to notifications, they'll be able to choose from the Categories you set up, signaling those are the things they are interested in. Their preferences will be saved as a Data Tag that you can use to target them using Audience Segments.  

Step 2. Create Audience Segments for the Categories you set up. 

In the OneSignal dashboard, Go to Audience>Segments and click on New Segment.

  • Name your Segment:

Users interested in Politics

  • Click on the + symbol next to User Tag and type in the Keys from your Categories you set up in Step 1. 

prefer_politics

  • Choose is from the dropdown and set 1 for the value. Then click on Create Segment.
  • Go ahead and repeat this for the other 2 categories that you set up in Step 1. 
  • Click on New Segment.
  • Name your Segment:

Users interested in World News

  • Click on the + symbol next to User Tag and next to `key` type in:

prefer_worldnews

  • Choose is from the dropdown and set 1 for the value. Then click on Create Segment.
  • And finally, Click on New Segment.
  • Name your Segment:

Users interested in Local News

  • Click on the + symbol next to User Tag and type in:

prefer_localnews

  • Choose is from the dropdown and set 1 for the value. Then click on Create Segment.

And that’s it. Now, whenever you send a message that is related to one of those categories, you can Target that specific Audience Segment to ensure that the message is relevant to them. For example, if you are posting a news item in the World News category, you'll want to send that Announcement to the Segment Users interested in World News.

Send a message to visitors who browse a lot without sharing

Let's encourage your readers to share your news items. In order to accomplish this, you need to track whether or not the subscriber has shared an item. 

Step 1. Add code to track shares. 

// replace ".social-share-button" with the class name of the element that submits a payment for item
const socialShareButton = document.querySelector(".social-share-button");
  if (
    typeof socialShareButton != "undefined" &&
    socialShareButton != null
  ) {
    socialShareButton.addEventListener("click", () => {
      OneSignal.push(function() {
          OneSignal.sendTags({
            share_count: 1
          });
       });
    });
  }
});
  • Set a Data Tag share_count to 1 for capturing that an item was purchased on your site. You'll set this Data Tag when some hits the "social share" button on your site or app. 

Step 2. Create a Segment for Visitors who read but don't share.

In the OneSignal dashboard, Go to Audience>Segments and click on New Segment.

  • Name your Segment:

3+ Visits No Share

  • Click on the + symbol next to User Tag and type in the Keys you captured in Step 1. 

share_count

  • Set this to does not exist.
  • Click + Add Filter and then click on the + symbol next to Session Count and select greater than with 2 sessions.
  • Click on Create Segment. Now, whenever a subscriber has returned to your site 3 times AND never shared a news item, they'll be added to this Segment. 

Step 3. Set up your Message Template

Go to Messages>Templates and click on New Push Template. In the body of the message template, cut and paste the text here or customize it to your liking.

  • Template Name: 

20% Discount Code

  • Title: 

Would a 20% discount at our shop help get the word out?

  • Message: 

Thanks for being an avid reader! We'd love to offer you a 20% discount at our merch store! Use coupon code: 20Discount at checkout!

  • Image: [Upload an icon to use, or leave it blank]
  • Launch URL: [insert the URL of your website with discount option in URL, example - http://mysite.com/?20DISCOUNT]

Step 4. Set up an Automated Message

In the OneSignal dashboard, go to Messages>Automated and click on New Automated Message and choose New Automated Push

  • Name your message.

3+ Visits No Share - 20% Discount

**You can name the message anything you like, but it's always best to be descriptive.**
  • Under Audience, choose the radio option for Send to Particular Segment.
  • Under Who should receive this campaign?, click the X next to the default to remove it. Then click the + symbol next to 3+ Visits No Purchase to add that Segment.
  • Under What template do you want to send, click the Dropdown arrow and choose the Template you created in Step 3.
  • Under Deliver to users more than once?, check the box for After a certain amount of time and set it to 2 weeks.
  • Click on Make Active.

And that’s it. Now, whenever a subscriber has returned more than 3 times AND they haven't shared a news post in the past, they will receive a message encouraging them to share with a 20% discount code on checkout until they share.

Send a message of appreciation for visitors who share your links

Let's encourage shares of your content or site on social media by thanking readers who share. In order to accomplish this, you need to track whenever a visitor clicks on a social sharing button on your site. 

Step 1. Add website code to track when the share button is clicked.

// replace ".social-share-button" with the class name of the element that submits a payment for item
const socialShareButton = document.querySelector(".social-share-button");
if (
  typeof socialShareButton != "undefined" &&
  socialShareButton != null
) {
  socialShareButton.addEventListener("click", () => {
    if (typeof localStorage !== "undefined") {
      var share_number = parseInt(localStorage.getItem("share_number"), 10);
      if (!isNaN(share_number)) {
        share_number += 1;
      } else {
        share_number = 0;
      }    
      localStorage.setItem("share_number", share_number)
      OneSignal.push(function() {
        OneSignal.isPushNotificationsEnabled(function(isEnabled) {
          console.log("isEnabled: ", isEnabled);
          if (isEnabled) {        
            OneSignal.sendTag("share_count", share_number, function(tagsSent) {
              // Callback called when tags have finished sending
              console.log('tags sent: ', tagsSent);
            });      
          }
        });
      });
    }
  });
}
  • Set Data Tag for share_count to capture when a share button is clicked. This number will increment each time that button is clicked.

Step 2. Create a Segment for visitors who social share 10 times.

In the OneSignal dashboard, Go to Audience>Segments and click on New Segment.

  • Name your Segment:

10 Shares

  • Click on the + symbol next to User Tag and type in the Keys you captured in Step 1.

share_count is greater than 9

  • Click on Create Segment

Now, whenever a visitor has shared 10 times they'll be added to that Audience Segment.

Step 3. Set up your Message Template

Go to Messages>Templates and click on New Push Template. In the body of the message template, cut and paste the text here or customize it to your liking.

  • Template Name: 

Thanks for sharing!

  • Title:

Sharing is caring!

  • Message: 

Thank you for taking the time to share our news with your friends! It's readers like you who make us work harder everyday to give you the best and most up to date news.

  • Image: [Upload an icon to use, or leave it blank]
  • Launch URL: [insert the URL of your website, example - http://mysite.com]

Step 4. Set up an Automated Message

In the OneSignal Dashboard, go to Messages>Automated and click on New Automated Message and choose New Automated Push

  • Name your message.

Thanks for sharing!

**You can name the Message anything you like, but it's always best to be descriptive.**
  • Under Audience, choose the radio option for Send to Particular Segment.
  • Under Who should receive this campaign?, click the X next to the default to remove it. Then click the + symbol next to 10 Shares to add that Segment.
  • Under What template do you want to send, click the Dropdown arrow and choose the Template you created in Step 3 - Thanks for sharing!.
  • Under Deliver to users more than once?, do not check any box.
  • Click on Make Active.

And that’s it. Now, whenever a visitor has shared more than 10 links, they will receive a message showing them your appreciation for them spreading the word about your site.

Send a Survey to Donors

Let's say that you want to be able to reward Donors to your site. In order to accomplish this, you would need to be able to track how much they've donated to you.

Step 1. Add website code to track donations.

// replace ".submit-payment" with the class name of the element that submits a payment for item
const submitPurchaseButton = document.querySelector(".submit-payment");
  if (
    typeof submitPurchaseButton != "undefined" &&
    submitPurchaseButton != null
  ) {
    // replace ".checkout-price-total" with the class name of the element that displays checkout price
    const checkoutPriceTotal = document.querySelector(".checkout-price-total")
      .innerText;
    submitPurchaseButton.addEventListener("click", () => {
      updateOSOnCartPurchase(checkoutPriceTotal);
    });
  }
});

function updateOSOnCartPurchase(checkoutPriceTotal) {
  let purchasePriceTotal = parseInt(checkoutPriceTotal);

  OneSignal.push(function () {
    OneSignal.getTags(function(tags) {
      var purchase_amount = 0;
      if (tags.purchase_amount) {
        purchase_amount = parseInt(tags.purchase_amount)
      }
      console.log("current purchase_amount: ", purchase_amount);
      purchase_amount += purchasePriceTotal
      OneSignal.sendTags({
        purchase_made: "true",
        purchase_amount: purchase_amount,
      }).then(function (tagsSent) {
        // Callback called when tags have finished sending
        console.log(tagsSent);
      });
    })
  });
}

This expands what we set earlier with the purchase_made tag and sets a Data Tag for purchase_amount to capture how much money a user has spent in your store.

Step 2. Create a Segment for Donors who've donated more than $10.

In the OneSignal dashboard, Go to Audience>Segments and click on New Segment.

  • Name your Segment:

Donated more than $10

  • Click on the + symbol next to User Tag and type in the Keys you captured in Step 1.

purchase_amount is greater than 9

  • Click on Create Segment

Now, whenever a visitor has donated more than $10 to your site, they'll be added to that Audience Segment.

Step 3. Set up your Message Template

Go to Messages>Templates and click on New Push Template. In the body of the message template, cut and paste the text here or customize it to your liking.

  • Template Name: 

Donor Survey

  • Title: 

We appreciate your kindness!

  • Message: 

Thank you for supporting our site with your donations! We'd love to for you to fill out a survey to let us know how we can improve our site for avid readers like you.

  • Image: [Upload an icon to use, or leave it blank]
  • Launch URL: [insert the URL to your survey, example - http://mysite.com/survey]

Step 4. Set up an Automated Message

In the OneSignal Dashboard, go to Messages>Automated and click on New Automated Message and choose New Automated Push

  • Name your message.

Donor Survey

**You can name the Message anything you like, but it's always best to be descriptive.**
  • Under Audience, choose the radio option for Send to Particular Segment.
  • Under Who should receive this campaign?, click the X next to the default to remove it. Then click the + symbol next to Donated more than $10 to add that Segment.
  • Under What template do you want to send, click the Dropdown arrow and choose the Template you created in Step 3 - Donor Survey.
  • Under Deliver to users more than once?, do not check any box.
  • Click on Make Active.

And that’s it. Now, whenever a reader has donated more than $10, they will receive a message directing them to complete a survey to get valuable feedback for your site.

We hope that you're now empowered for success with your news or media site!

The preceding examples are just the tip of the iceberg. You can customize the examples to your specific needs and brand voice, or come up with new ways to super-charge and automate your reader re-engagement strategy.

OneSignal paid plans give you access to more complex implementations that are even better tailored to your readers, often increasing conversion rates which leads to greater traffic and ad revenue for your news or media site. For a look at more advanced implementation examples, please check out our Documentation.