How to use Instagram content in emails (classic editor)

Last updated at:

You will learn

Learn how to set up a custom web feed with your Instagram account using an RSS feed generator, and how to display the feed in your emails. With a custom web feed, you can connect your Instagram content to your emails and dynamically display your latest Instagram photos, captions, and more. 

Set up an Instagram web feed

To set up an Instagram web feed without the help of a developer or Klaviyo Partner: 

  1. Create an account with an RSS feed generator tool
  2. Navigate to My Feeds
  3. In the upper right, click New Feed
  4. In the Enter Webpage URL field, add your Instagram URL, following the format
  5. Click Generate
  6. Click Save to My Feeds

Note that this RSS feed generator app requires a paid plan in order to host an Instagram RSS feed. You can use any RSS feed generator, but if you use a different app, you may need to customize the sample code in the section below. 

Once the feed is saved, navigate to the feed page and locate the feed URL. It should follow this format:

The RSS feed generator app

As an alternative to this method, you can set up an Instagram web feed using their Basic Display API, or by using a third-party app. Certain Klaviyo Partners offer this as a service, including Yotpo and FourSixty

Set up your feed in Klaviyo 

Once you’ve set up your RSS feed:

  1. Navigate to the Data Feeds tab
  2. Click Add Web Feed The Data Feeds tab in Klaviyo
  3. Name your feed 
  4. Enter the RSS feed URL you just generated as the Feed URL
  5. Set the Request Method to GET and the Content Type to XML
  6. Click Add Data Feed
    The settings needed for an Instagram web feed in Klaviyo

Pull Instagram content into your emails

If you are using a third-party platform or Instagram’s Basic Display API to generate your feed, follow our guide on adding a custom web feed to an email. If you’ve used the RSS Feed app recommended above, use the code below to display the three most recent items from your Instagram feed in an email. 

If you are using the classic template editor, in the footer of the email editor click the Data Feeds link and select your Instagram feed. If you're using the new template editor, skip ahead to the next step. 

A user enables the instagram web feed in a template

Add a new text block to your template, and click Source in the block editor. Copy the following code into the Source of the block, and make sure to replace FEED_NAME with your feed name. 

<div>{% for item in|slice:":3" %}
<table style="display:inline-block; margin-left:auto; margin-right:auto">
			<td style="padding-right:15px;padding-left:18px; width:150px"><a href="{{ }}">
			<img src="{% if item|lookup:'media:content'|lookup:'0'|lookup:'@url' %}{{ item|lookup:'media:content'|lookup:'0'|lookup:'@url' }}{% else %}{{ item|lookup:'media:content'|lookup:'@url' }}{% endif %}" style="margin: 1px; max-width: 150px; height: auto;" /></a>
{% endfor %}</div>

Your Instagram feed will not load when previewing the message in Klaviyo. Send a preview email to your own inbox to make sure it appears correctly.

If you’d like to show more than 3 recent posts, adjust the filter |slice:":3" to include the number of posts you’d like to display (e.g. |slice:":6" to show six posts). 

If you’d like to add additional fields to your table (e.g., captions or the date an image was posted), follow our guides on adding custom web feeds to emails to adjust the code above as needed. 

We only recommend using custom HTML for technically savvy marketers, or for anyone who has access to a developer. While our product does support custom HTML, our support team is unable to help you build out your custom templates beyond offering the general guidance covered in this documentation. To maintain the security of your data, Klaviyo's support team is not able to open your HTML files.

If you need developer assistance to set this up, reach out to one of Klaviyo’s Partners

Additional resources 

Was this article helpful?
123 out of 272 found this helpful