Skip to main content
Solved

Dynamic button for to buy viewed item


Forum|alt.badge.img+3

I’m sure it’s in here somewhere, but I’ve looked and looked and can’t find what I’m looking for. I have an email that contains links to recently viewed items. I want to add a button that sends them to the specific product.

So basically, I want to duplicate the “Buy Now” button that’s native to the product block, but send them to their most viewed item. 

 

Best answer by Dov

Hi @porter,

Thank you for sharing your question with the Klaviyo Community.

You can use the following snippet in the button block:

{{ person.ViewedItems.0.Url }}

I assume you have already gone through our doc on inserting recently viewed items into an email, if not I would check that out as well. I also recommend reviewing our doc on using event variables to personalize flows and past posts on this topic, linking those below as well

Thanks for being a member of our Community!

View original
Did this topic or the replies in the thread help you find an answer to your question?

3 replies

Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • Answer
  • July 13, 2021

Hi @porter,

Thank you for sharing your question with the Klaviyo Community.

You can use the following snippet in the button block:

{{ person.ViewedItems.0.Url }}

I assume you have already gone through our doc on inserting recently viewed items into an email, if not I would check that out as well. I also recommend reviewing our doc on using event variables to personalize flows and past posts on this topic, linking those below as well

Thanks for being a member of our Community!


Forum|alt.badge.img+3
  • Author
  • Contributor I
  • 2 replies
  • July 13, 2021

This is fantastic! Is there a blog or article that contains all these different snippets?


Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • July 13, 2021

Hi @porter,

The tag is included in inserting recently viewed items into an email. In addition to those resources, I also recommend checking out template tags and variable syntax for more great information on populating templates with dynamic variables.