Add a banner with dynamic text

I wanted to add a small banner at the bottom of our website of people viewing and people who recently purchased. It’s something similar to the one attached. How do I programmatically make the text in the banner dynamic, depending on what product was recently bought?

Here’s a sample: