Skip to main content
Contributor I
July 13, 2021
Solved

Dynamic button for to buy viewed item

  • July 13, 2021
  • 3 replies
  • 1198 views

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. 

 

    This topic has been closed for replies.
    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!

    3 replies

    Dov
    DovAnswer
    Klaviyo Alum
    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!

    DD
    porterAuthor
    Contributor I
    July 13, 2021

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

    Dov
    Klaviyo Alum
    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. 

    DD