Email alerts for expiring dynamic creative end dates

If you are targeting dynamic content based on scheduled dates and times, you may have run into issues with expiring end dates. Once an end date expires, the content in that row is no longer eligible to serve. To help you stay on top of expiring content, you can set up an email alert by copying and pasting a script into your Google Sheets feed.

Add an email alert

  1. Download the script text.
  2. In your feed, navigate to Tools > Script editor.
  3. Select Blank Project.
  4. Name the project in the top left hand corner.
  5. Delete all of the text in the script window (i.e. function myFunction() { }). It's important that all of the text is deleted for the alert to work correctly.
  6. Copy and paste the entire script from the downloaded file into the window.
  7. Save the project.
  8. Run the script by either clicking the play button or navigating to Run > alertFunction.
  9. Since this script sends emails, you will be required to authorize the script. Email alerts will be sent from your email address since you're authorizing the script.
  10. Once the script runs, a new tab is created in your feed, called Email Info. Do NOT change the name of this tab, or the script will break. 
  11. In the Email Info tab, you'll see questions in column A (red cells). Follow the instructions for each question, entering your answer in column B (yellow cells).
    If you are using scheduling in more than one feed and want to set up alerts for all feeds, comma-separate your answers in Column B (e.g. Sheet 1, Sheet 2). Make sure to keep the order of the answers consistent for each question.
  12. Run the script again. You will notice that the cells in Column B turn green if you set up the alert correctly. If there are any errors, a dialog box will indicate what error has occurred. You should also receive an email if there are any rows in the feed expiring within 24 hours.
  13. The final step is to set the trigger, which tells the script to run automatically once a day. In the script, navigate to Resources > Current project’s triggers.
  14. Click the No triggers set up. Click here to add one now. link.
  15. In the Run dropdown, select alertFunction.
  16. In the Events dropdowns, select Time-driven, then Day timer, and then select the one-hour timeframe in which you want the alert to run. This means that the script will run once a day during the timeframe you selected.
  17. You can also click on the notifications link beneath the Time-driven dropdown to set up alerts for script failures.
  18. Click Save.

You're all set! You should begin receiving email alerts in the next scheduled timeframe.

Unsubscribe from alerts

To stop sending email alerts to specific email addresses, remove those email addresses from cell B9 of the Email Info tab of your feed. The next time the script is scheduled to run, this change will be effective.

To stop sending email alerts for a specific feed, remove that feed name and the corresponding answers for that feed from column B. This change will take effect the next time the script is scheduled to run.

To completely stop sending ALL email alerts, enter "yes" in response to the final question on the Email Info tab. The next time the script is scheduled to run, cell B15 will turn red.

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

Search
Clear search
Close search
Google apps
Main menu
14753688184633362285
true
Search Help Center
true
true
true
true
true
74220
false
false