Day 29 Challenge Resources
Challenge
A media agency wants to offer a personalized experience to its subscribers by creating a landing page that recommends the top three bestsellers from the New York Times bestseller list based on each subscriber’s main interest. The main interest is stored in a sendable data extension. To achieve this personalized experience, the marketer plans to use AMPscript and SSJS.
Resources
This challenge involves retrieving data from an API endpoint. Specifically, we will be using the Books API to access information about bestsellers from the New York Times bestseller list. To access the API key, you will need to create your own account here. Once you have obtained your API key, use the following URL to retrieve the data (remember to replace “your_API_key” with your actual key): https://api.nytimes.com/svc/books/v3/lists/current/hardcover-fiction.json?api-key=YOURKEY
The following are great examples how you can leverage SSJS with AMPscript:
- Example SSJS for SFMC that retrieves weather forecast from an external API
- Passing variable values between AMPscript, Server-Side JavaScript and Client-Side JavaScript
Dataset
SubscriberKey | FirstName | LastName | Interest | |
---|---|---|---|---|
9083 | james.bond@mi6.com | James | Bond | advice-how-to-and-miscellaneous |
5367 | tony.stark@starkindustries.com | Tony | Stark | hardcover-fiction |
2961 | ellen.ripley@weyland.com | Ellen | Ripley | hardcover-nonfiction |
8753 | indiana.jones@marshall.edu | Indiana | Jones | combined-print-and-e-book-nonfiction |
5619 | harry.potter@hogwarts.edu | Harry | Potter | hardcover-fiction |
To list the top three books, you may need to parse the “Interest” variable from the sendable data extension to the CloudPage URL and use SSJS to make an API call. Additionally, you can include a link to each asset directly on the landing page.