Embed feed for Yammer Classic

Note

Starting January 31, 2025, Microsoft will retire and no longer support classic Embed Feed. To avoid a broken feed experience, we recommend that you replace your classic embed feeds as soon as possible using these instructions, Migrate classic feeds in HTML apps with Embed feed for Engage.

To display feeds from Yammer in your HTML based application, Yammer provides embeddable JavaScript widgets that display a snapshot of a specified feed and function as a scaled-down version of Yammer.

Prerequisites

To use Embed you need an HTML container 400 pixels or larger in your application. See here for a list of supported browsers. Yammer Embed only works on desktop browsers, not on mobile browsers.

Since Yammer requires an HTML container at least 400 pixels wide, utilizing the display:none attribute on the container will prevent Embed from displaying properly. Also, rendering Yammer Embed with the display:none property causes issues in Internet Explorer and should not be used. If you need to implement a hidden Yammer Embed widget that will later be shown, the best option is to implement a positioning strategy.

Microsoft 365 apps and services will not support Internet Explorer 11 starting August 17, 2021 (Microsoft Teams will not support Internet Explorer 11 earlier, starting November 30, 2020). Learn more.

Please note that Internet Explorer 11 will remain a supported browser. Internet Explorer 11 is a component of the Windows operating system and follows the Lifecycle Policy for the product on which it is installed.

Usage

Using embed, you can display a single My Feed, Group Feed, Topic Feed, User Feed or OG object feed. Including more than one embedded feed on a single web page is not supported. Users will need to log in to view the feed (including feeds from External networks). Additionally, the feed is restricted to users of the network specified (see below). Note: Starting December 2020, the Embeds will be upgraded to the new Yammer, network by network. Learn more.

My Feed

To display My Feed, add the following embed code to your HTML page. Note: Height, Width values are for illustrative purposes only. Please set your own as desired.

<!DOCTYPE HTML>
<html>
<head></head>
<body>
    <script type="text/javascript" src="https://c64.assets-yammer.com/assets/platform_embed.js"></script>
    <div id="embedded-feed" style="height:400px;width:500px;"></div> 
    <script>
        yam.connect.embedFeed({
            container: '#embedded-feed',
            network: 'fourleaf.com'  // network permalink (see below)
        });
    </script>
</body>
</html>

For the My Feed/Home feed type, Embed shows slightly different messages than are included in the home feeds available in Yammer web, desktop, or mobile. In Embed My Feed/Home feed, users will see an algorithmic assortment of Yammer posts from their groups and other public groups in their Yammer network. In Yammer web, desktop, and mobile, users can select Discovery, All, or Following feeds, but these aren't available in Embed.

Specified Feed

To display a Group Feed, a Topic Feed, or a User Feed add the following embed code to your HTML page. Note that you can also generate this code for a specific group feed using the “Embed this feed” quick link in the right sidebar of any group (see the screenshot above). Also, for User and Topic feeds, you can specify which group should be the default for posts from the embedded feed using the defaultGroupId parameter.

To retrieve the feed ID and network permalink, please navigate to the feed in the Yammer web application and copy it from the URL:

<script type="text/javascript" src="https://c64.assets-yammer.com/assets/platform_embed.js"></script>
<div id="embedded-feed" style="height:400px;width:500px;"></div>
<script>
    yam.connect.embedFeed({
        container: '#embedded-feed',
        network: 'fourleaf.com',
        feedType: 'group',                // can be 'group', 'topic', or 'user'    
        feedId: '123',                     // feed ID from the instructions above
        config: {
             defaultGroupId: 3257958      // specify default group id to post to 
        }
    });    
</script>

Open Graph Feed

To display an Open Graph feed of a URL place the following embed code to your HTML page. Note: Height, Width values are for illustrative purposes only. Please set your own as desired.

<script type="text/javascript" src="https://c64.assets-yammer.com/assets/platform_embed.js"></script>
<div id="embedded-feed" style="height:400px;width:500px;"></div>
<script>
yam.connect.embedFeed({
    container: '#embedded-feed',
    network: 'contoso.com',
    feedType: 'open-graph',
    feedId: '',
    objectProperties: { 
        url: 'http://www.opengraphpage.com/',
        type: 'page'
    }
});
</script>