{"id":27804,"date":"2016-08-24T23:01:25","date_gmt":"2016-08-24T15:01:25","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=27804"},"modified":"2022-07-13T19:41:59","modified_gmt":"2022-07-13T11:41:59","slug":"amp-components-social-media","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/","title":{"rendered":"8 AMP Components for Social Media Integration"},"content":{"rendered":"<p>The biggest conflict that Google\u2019s mobile web standard, <strong><a href=\"https:\/\/www.ampproject.org\/\" target=\"_blank\" rel=\"noopener\">Accelerated Mobile Pages<\/a><\/strong> needs to solve is <strong>making mobile sites faster<\/strong>, while <strong>keeping them functional & rich in content<\/strong>. These days rich and engaging content can hardly be imagined without embeds from popular social media sites \u2014 tweets, videos, audios, posts, photos.<\/p>\n<p><strong>Extended AMP Components<\/strong> \u2014 <a href=\"https:\/\/www.hongkiat.com\/blog\/important-amp-components\/\">among other great features<\/a> \u2014 provide a great way to integrate <abbr title=\"Accelerated Mobile Pages\">AMP<\/abbr> documents with different social content types.<\/p>\n<p class=\"recommended_top\">\n\t\t\t\t\t<strong>Read Also:<\/strong>\u00a0\n\t\t\t\t\t<a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/guide-to-accelerated-mobile-pages-amp\/\">Beginner\u2019s Guide to Accelerated Mobile Pages (AMP)<\/a>\n\t\t\t\t<\/p>\n<h2>How Extended AMP Components Work<\/h2>\n<p>At the core of AMP\u2019s philosophy there are Google\u2019s <strong><a href=\"https:\/\/amp.dev\/about\/how-amp-works\/?referrer=ampproject.org\" target=\"_blank\" rel=\"noopener\">best performance practices<\/a><\/strong>. To improve page load times, the AMP standards restrict <strong>how you can use front-end technologies<\/strong>. For instance, you cannot use custom JavaScript, external stylesheets, and any HTML element that loads external resources, such as the <code>&lt;img&gt;<\/code> tag.<\/p>\n<p>In exchange, you get a bunch of <strong><a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/docs\/spec\/amp-html-components.md\" target=\"_blank\" rel=\"noopener\">AMP Components<\/a><\/strong> you can use to <strong>display external resources<\/strong>, such as images, videos, audios, advertisements, etc. on your site.<\/p>\n<p>AMP Components are <strong>specific HTML tags<\/strong> that can be used similarly to ordinary HTML tags. A few of them are <strong><a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/docs\/developing.md\" target=\"_blank\" rel=\"noopener\">built in<\/a><\/strong> to the AMP runtime, while the majority <strong><a href=\"https:\/\/github.com\/ampproject\/amphtml\/tree\/main\/extensions\" target=\"_blank\" rel=\"noopener\">works as extensions<\/a><\/strong>. Components that makes social media integration possible on AMP pages <strong>are all extended components<\/strong>.<\/p>\n<p class=\"recommended_top\">\n\t\t\t\t\t<strong>Read Also:<\/strong>\u00a0\n\t\t\t\t\t<a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/important-amp-components\/\">Top 10 Essential AMP Components for Mobile Optimization<\/a>\n\t\t\t\t<\/p>\n<p><a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/docs\/spec\/amp-html-components.md#extended-components\" target=\"_blank\" rel=\"noopener\">Extended AMP Components<\/a> require you to <strong>import the belonging script<\/strong> in the <code>&lt;head&gt;<\/code> section of your AMP HTML document. As AMP is an open-source project, the number of extended components may grow in the future.<\/p>\n<p>In this post we have collected a handful of AMP Components that can help you <strong>with social media integration<\/strong>. Keep in mind that the versions of the scripts <strong>may change over time<\/strong>, so always check out the <a href=\"https:\/\/github.com\/ampproject\/amphtml\/tree\/main\/extensions\" target=\"_blank\" rel=\"noopener\">documentation<\/a> before you include them on your site.<\/p>\n<h2>1. <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-facebook\/amp-facebook.md\" target=\"_blank\" rel=\"noopener\"><code>amp-facebook<\/code><\/a><\/h2>\n<p><code>&lt;amp-facebook&gt;<\/code>  makes it possible to <strong>embed a Facebook post or video<\/strong> into an AMP page.<\/p>\n<p>You always need to <strong>specify the dimensions of the embedded post<\/strong>, which means you need to add a <code>width<\/code> and a <code>height<\/code> attribute with values in integer pixels. You can find the proper dimensions by clicking on the \"Embed\" menu on the top of the Facebook post.<\/p>\n<p>You\u2019re also required to <strong>add the URL of the given post<\/strong> in the <code>data-href<\/code> attribute. You can find the URL by clicking on the timestamp of the Facebook post, and the browser will insert the unique URL into the address bar.<\/p>\n<p>If you want to <strong>embed a video without the belonging Facebook post<\/strong>, add the optional <code>data-embed-as=\"video\"<\/code> attribute<\/p>\n<p>If you want to <strong>make your embed responsive<\/strong> use the <a href=\"https:\/\/amp.dev\/documentation\/guides-and-tutorials\/develop\/style_and_layout\/control_layout\/?referrer=ampproject.org\" target=\"_blank\" rel=\"noopener\"><code>layout<\/code><\/a> attribute with the <code>\"responsive\"<\/code> value. You can also use the optional <code>layout<\/code> attribute on any other AMP component to control its layout.<\/p>\n<p><strong>Code example:<\/strong><\/p>\n<pre>\r\n&lt;amp-facebook width=\"500\" height=\"485\" layout=\"responsive\"\r\n    data-href=\"https:\/\/www.facebook.com\/hongkiatcom\/posts\/10154256404668592\"&gt;\r\n&lt;\/amp-facebook&gt;\r\n<\/pre>\n<p><strong>Code preview:<\/strong><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-facebook-example.jpg\" width=\"700\" height=\"533\" alt=\"AMP Example Facebook\"><\/figure>\n<p><strong>Script to include:<\/strong><\/p>\n<pre>\r\n&lt;script async custom-element=\"amp-facebook\"\r\n    src=\"https:\/\/cdn.ampproject.org\/v0\/amp-facebook-0.1.js\"&gt;\r\n&lt;\/script&gt;\r\n<\/pre>\n<p class=\"note\">Here\u2019s a look at a <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/examples\/facebook.amp.html\" target=\"_blank\" rel=\"noopener\">working example<\/a> on how to use <code>&lt;amp-facebook&gt;<\/code> on a complete AMP HTML page.<\/p>\n<h2>2. <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-twitter\/amp-twitter.md\" target=\"_blank\" rel=\"noopener\"><code>amp-twitter<\/code><\/a><\/h2>\n<p>You can <strong>embed tweets<\/strong> into AMP pages by using the <code>&lt;amp-twitter&gt;<\/code> component.<\/p>\n<p>To do so, you need to <strong>specify the ID of the tweet<\/strong> in the <code>data-tweetid<\/code> attribute. You can modify how the tweet is displayed by adding any of the\n  <a href=\"https:\/\/dev.twitter.com\/web\/javascript\/creating-widgets#create-tweet\" target=\"_blank\" rel=\"noopener\">display options of the Twitter APi<\/a> as a <a href=\"https:\/\/www.hongkiat.com\/blog\/better-ux-html-data-attributes\/\"><code>data-*<\/code> HTML5 attribute<\/a>.<\/p>\n<p>For instance, in the example below I used the Twitter API\u2019s <code>linkColor<\/code> display option as <code>data-link-color<\/code> (its <code>data-*<\/code> format) to change the default link color to the color Hongkiat.com uses on its Twitter account.<\/p>\n<p><strong>Code example:<\/strong><\/p>\n<pre>\r\n&lt;amp-twitter width=\"506\" height=\"338\" layout=\"responsive\"\r\n    data-tweetid=\"765234426166915072\" data-link-color=\"#698aba\"&gt;\r\n&lt;\/amp-twitter&gt;\r\n<\/pre>\n<p><strong>Code preview:<\/strong><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-twitter-example.jpg\" width=\"600\" height=\"369\" alt=\"AMP Twitter Example\"><\/figure>\n<p>The <code>&lt;amp-twitter&gt;<\/code> component is not perfect yet, <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-twitter\/amp-twitter.md#behavior\" target=\"_blank\" rel=\"noopener\">Github docs says<\/a> that <q>Twitter does not currently provide an API that yields fixed aspect ratio Tweet embeds<\/q>.<\/p>\n<p>This means you need to <strong>manually set the <code>width<\/code> and <code>height<\/code> attributes<\/strong>, as the AMP runtime sometimes doesn\u2019t display a part (usually the bottom) of the tweet.<\/p>\n<p>It\u2019s always a good idea to check how your embedded tweets look like before publishing the AMP page.<\/p>\n<h3>Add a Placeholder<\/h3>\n<p>Although it\u2019s not required, the documentation recommends <strong>adding a placeholder<\/strong> in case the tweet doesn\u2019t load at once.<\/p>\n<p>The <a href=\"https:\/\/amp.dev\/documentation\/guides-and-tutorials\/develop\/style_and_layout\/control_layout\/?referrer=ampproject.org#placeholder\" target=\"_blank\" rel=\"noopener\"><code>placeholder<\/code><\/a> attribute can be used on each AMP component. The placeholder is <strong>shown immediately<\/strong> if the final resources are not available. When the AMP element loads, it <strong>hides its placeholder<\/strong>.<\/p>\n<p>Take a look at how the above example code looks like <strong>with a placeholder<\/strong>. On Twitter, I simply clicked on the <span class=\"key\">Embed Tweet<\/span> button, copy-pasted the embeddable blockquote (without the script at the end), and added the <code>placeholder<\/code> attribute to the <code>&lt;blockquote&gt;<\/code> tag.<\/p>\n<p><strong>Code example with placeholder:<\/strong><\/p>\n<pre>\r\n&lt;amp-twitter width=\"506\" height=\"338\" layout=\"responsive\"\r\n  data-tweetid=\"765234426166915072\" data-link-color=\"#698aba\"&gt;\r\n  &lt;blockquote placeholder class=\"twitter-tweet\" data-lang=\"en\"&gt;\r\n    &lt;p lang=\"en\" dir=\"ltr\"&gt;How to Validate Accelerated Mobile Pages\r\n      (&lt;a href=\"https:\/\/twitter.com\/hashtag\/AMP?src=hash\"&gt;#AMP&lt;\/a&gt;)\r\n      &lt;a href=\"https:\/\/twitter.com\/hashtag\/google?src=hash\"&gt;#google&lt;\/a&gt;\r\n      &lt;a href=\"https:\/\/twitter.com\/hashtag\/seo?src=hash\"&gt;#seo&lt;\/a&gt;\r\n      &lt;a href=\"https:\/\/t.co\/eVOSAtr5Ax\"&gt;https:\/\/t.co\/eVOSAtr5Ax&lt;\/a&gt;\r\n    &lt;\/p&gt;\r\n    \u2014 Hongkiat (@hongkiat)\r\n      &lt;a href=\"https:\/\/twitter.com\/hongkiat\/status\/765234426166915072\"&gt;\r\n        August 15, 2016&lt;\/a&gt;\r\n  &lt;\/blockquote&gt;\r\n&lt;\/amp-twitter&gt;\r\n<\/pre>\n<p><strong>Script to include:<\/strong><\/p>\n<pre>\r\n&lt;script async custom-element=\"amp-twitter\"\r\n    src=\"https:\/\/cdn.ampproject.org\/v0\/amp-twitter-0.1.js\"&gt;\r\n&lt;\/script&gt;\r\n<\/pre>\n<p class=\"note\">Check out <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/examples\/twitter.amp.html\" target=\"_blank\" rel=\"noopener\">an example<\/a> of a full HTML AMP page using the <code>&lt;amp-twitter&gt;<\/code> component.<\/p>\n<h2>3. <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-instagram\/amp-instagram.md\" target=\"_blank\" rel=\"noopener\"><code>amp-instagram<\/code><\/a><\/h2>\n<p>With <code>&lt;amp-instagram&gt;<\/code>, you can <strong>embed Instagram photos and videos<\/strong> into your AMP pages.<\/p>\n<p>You are required to <strong>specify the dimensions<\/strong> of the embed with the <code>width<\/code> and <code>height<\/code> attributes, and you also have to <strong>add the identifier<\/strong> of the Instagram photo or video using the <code>data-shortcode<\/code> attribute.<\/p>\n<p>You can find the identifier at the end of the URL, for the example for the photo below the URL is <a href=\"https:\/\/www.instagram.com\/p\/-PFt7tF8Km\/\" target=\"_blank\" rel=\"noopener\"><code>https:\/\/www.instagram.com\/p\/-PFt7tF8Km\/<\/code><\/a>, so I need to use <code>-PFt7tF8Km<\/code> as value for the <code>data-shortcode<\/code> attribute.<\/p>\n<p><strong>Code example:<\/strong><\/p>\n<pre>\r\n&lt;amp-instagram data-shortcode=\"-PFt7tF8Km\"\r\n    width=\"400\" height=\"400\" layout=\"responsive\"&gt;\r\n&lt;\/amp-instagram&gt;\r\n<\/pre>\n<p><strong>Code preview:<\/strong><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-instagram-example.jpg\" width=\"700\" height=\"598\" alt=\"AMP Instagram Example\"><\/figure>\n<p><strong>For responsive layouts<\/strong>, AMP automatically calculates the required space which also <strong>includes the \u201cInstagram chrome\u201d<\/strong> (account name, date, number of likes, etc).<\/p>\n<p>This means you can use any value for <code>width<\/code> and <code>height<\/code>, until the <strong>two values are equal<\/strong> (Instagram photos are usually square), as the AMP runtime will resize the image according to the available space.<\/p>\n<p>If the photo doesn\u2019t happen to be a square, you have to specify its actual <code>width<\/code> and <code>height<\/code> values.<\/p>\n<p>For<strong> fixed layouts<\/strong>, you need to <strong>include the extra space<\/strong> (top and bottom: +48 px, left and right: +8px) needed for the Instagram chrome when you calculate the image dimensions.<\/p>\n<p><strong>Script to include:<\/strong><\/p>\n<pre>\r\n&lt;script async custom-element=\"amp-instagram\"\r\n    src=\"https:\/\/cdn.ampproject.org\/v0\/amp-instagram-0.1.js\"&gt;\r\n&lt;\/script&gt;\r\n<\/pre>\n<p class=\"note\">Check out full AMP HTML page examples on <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/examples\/instagram.amp.html\" target=\"_blank\" rel=\"noopener\">how to use the <code>&lt;amp-instagram&gt;<\/code> component<\/a>.<\/p>\n<h2>4. <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-pinterest\/amp-pinterest.md\" target=\"_blank\" rel=\"noopener\"><code>amp-pinterest<\/code><\/a><\/h2>\n<p><code>&lt;amp-pinterest&gt;<\/code> allows you to <strong>embed either a Pin widget or a <span class=\"key\">Pin It<\/span> button<\/strong> into an AMP HTML document.<\/p>\n<h3>Embed a Pin Widget<\/h3>\n<p>To embed a Pin widget, you have to specify the dimensions, the URL of the pin using the <code>data-url<\/code> attribute, and you also need to add the <code>data-do=\"embedPin\"<\/code> attribute.<\/p>\n<p><strong>Code example (default size):<\/strong><\/p>\n<pre>\r\n&lt;amp-pinterest width=\"245\" height=\"330\" data-do=\"embedPin\"\r\n  data-url=\"https:\/\/uk.pinterest.com\/pin\/422986589975891640\/\"&gt;\r\n&lt;\/amp-pinterest&gt;\r\n<\/pre>\n<p>As the default Pin widget is quite small, you can also opt for a bigger version by using the <code>data-width=\"medium\"<\/code> attribute.<\/p>\n<p><strong>Code example (medium size):<\/strong><\/p>\n<pre>\r\n&lt;amp-pinterest width=\"355\" height=\"410\" data-do=\"embedPin\"\r\n  data-width=\"medium\"\r\n  data-url=\"https:\/\/uk.pinterest.com\/pin\/422986589975891640\/\"&gt;\r\n&lt;\/amp-pinterest&gt;\r\n<\/pre>\n<p><strong>Code preview (medium size):<\/strong><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-pinterest-example.jpg\" width=\"550\" height=\"432\" alt=\"AMP Pinterest Example\"><\/figure>\n<h3>Display a <span class=\"key\">Pin It<\/span> Button<\/h3>\n<p>You can also <strong>add a <span class=\"key\">Pin It<\/span> button<\/strong> to your AMP page with the help of the <code>&lt;amp-pinterest&gt;<\/code> component. Apart from the <code>width<\/code> and <code>height<\/code> dimensions, you\u2019re <strong>required to specify four attributes<\/strong> in order to embed the <span class=\"key\">Pin It<\/span> button:<\/p>\n<ol>\n<li><code>data-do=\"buttonPin\"<\/code> to let the AMP runtime know that this will be a <span class=\"key\">Pin It<\/span> button<\/li>\n<li><code>data-url<\/code> with the URL you want share<\/li>\n<li><code>data-media<\/code> with the absolute URL of the image you want users to pin<\/li>\n<li><code>data-description<\/code> with the description you want to appear in the Pin create form<\/li>\n<\/ol>\n<p>There are <strong>many different button sizes<\/strong>, to choose from, check the docs for all sizes <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-pinterest\/amp-pinterest.md#sizing-the-pin-it-button\" target=\"_blank\" rel=\"noopener\">available<\/a>.<\/p>\n<p><strong>Code example:<\/strong><\/p>\n<p>In this example, I created a <span class=\"key\">Pin It<\/span> button that would allow users to pin an image from  <a href=\"https:\/\/www.hongkiat.com\/blog\/best-android-twitter-clients\/\">this former Hongkiat.com post<\/a>. I used the small rectangular button size.<\/p>\n<pre>\r\n&lt;figure&gt;\r\n  &lt;amp-img src=\"image.jpg\" width=\"640\" height=\"385\"\r\n        alt=\"Image Example\"&gt;\r\n  &lt;\/amp-img&gt;\r\n  &lt;amp-pinterest height=\"28\" width=\"56\" data-do=\"buttonPin\"\r\n        data-url=\"https:\/\/www.hongkiat.com\/blog\/best-android-twitter-clients\/\"\r\n        data-media=\"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/640x410\/best-android-twitter-clients.jpg\"\r\n        data-description=\"Best 5 Free Twitter Clients for Android\"&gt;\r\n   &lt;\/amp-pinterest&gt;\r\n&lt;\/figure&gt;\r\n<\/pre>\n<p><strong>Code preview:<\/strong><\/p>\n<p>Note that you need to <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/docs\/spec\/amp-html-format.md\" target=\"_blank\" rel=\"noopener\">use additional CSS<\/a> to display the <span class=\"key\">Pin It<\/span> button on top of the image.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-pin-button-example.jpg\" width=\"600\" height=\"361\" alt=\"AMP Pin Button Example\"><\/figure>\n<p>You can also <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-pinterest\/amp-pinterest.md#follow-button\" target=\"_blank\" rel=\"noopener\">create a Pinterest <span class=\"key\">Follow<\/span> button<\/a> by using the <code>data-do=\"buttonFollow\"<\/code> attribute, and specifying the name you want to display inside the <span class=\"key\">Follow<\/span> button in the <code>data-label<\/code> & the URL of your account in the <code>data-href<\/code> attribute.<\/p>\n<p><strong>Code example (Follow button):<\/strong><\/p>\n<pre>\r\n&lt;amp-pinterest height=\"20\" width=\"87\" data-do=\"buttonFollow\"\r\n  data-href=\"https:\/\/www.pinterest.com\/hongkiat\/\"\r\n  data-label=\"Hongkiat\"&gt;\r\n&lt;\/amp-pinterest&gt;\r\n<\/pre>\n<p><strong>Script to include:<\/strong><\/p>\n<pre>\r\n&lt;script async custom-element=\"amp-pinterest\"\r\n    src=\"https:\/\/cdn.ampproject.org\/v0\/amp-pinterest-0.1.js\"&gt;\r\n&lt;\/script&gt;\r\n<\/pre>\n<p class=\"note\">In the <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/examples\/pinterest.amp.html\" target=\"_blank\" rel=\"noopener\">Github examples<\/a> you can see many different use cases of the <code>&lt;amp-pinterest&gt;<\/code> component.<\/p>\n<h2>5. <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-soundcloud\/amp-soundcloud.md\" target=\"_blank\" rel=\"noopener\"><code>amp-soundcloud<\/code><\/a><\/h2>\n<p><a href=\"https:\/\/soundcloud.com\/\" target=\"_blank\" rel=\"noopener\">SoundCloud<\/a> is a popular audio distribution platform where users can share their music. With the help of the <code>&lt;amp-soundcloud&gt;<\/code> component you can <strong>play SoundCloud tracks<\/strong> right from your AMP HTML page.<\/p>\n<p>This component can <strong>only be used with <a href=\"https:\/\/amp.dev\/documentation\/guides-and-tutorials\/develop\/style_and_layout\/control_layout\/?referrer=ampproject.org#supported-values-for-layout-attribute\" target=\"_blank\" rel=\"noopener\"><code>fixed-height<\/code><\/a> layout<\/strong> which means you only need to specify the <code>height<\/code>, and the width will be calculated by the AMP runtime. As a result the embedded SoundCloud audio player will <strong>fill all the available horizontal space<\/strong>.<\/p>\n<p>The <code>&lt;amp-soundcloud&gt;<\/code> component can be displayed in <strong>either classic or visual mode<\/strong>. You can choose from the two modes by setting the value of the <code>data-visual<\/code> attribute to either <code>true<\/code> or <code>false<\/code> (the default is <code>false<\/code>).<\/p>\n<p>In both modes, you have to use the <code>data-trackid<\/code> attribute to <strong>specify the identifier<\/strong> of the audio; you can find the audio ID by clicking the <span class=\"key\">Share<\/span> button below the audio player on SoundCloud.com, and looking up the long-form URL inside the Embed code.<\/p>\n<h3>Classic Mode<\/h3>\n<p>The <strong><code>Classic Mode<\/code><\/strong> displays a small thumbnail image on the left, and the audio player on the right. You can get the proper value for the <code>height<\/code> attribute from the Embed code on SoundCloud.com.<\/p>\n<p>In Classic Mode, you can specify the color of the audio player if you want using the <code>data-color<\/code> attribute (you cannot do this in Visual Mode).<\/p>\n<p><strong>Code example (classic mode):<\/strong><\/p>\n<pre>\r\n&lt;amp-soundcloud height=\"166\" layout=\"fixed-height\"\r\n      data-trackid=\"264419072\" data-color=\"ff5c44\"&gt;\r\n&lt;\/amp-soundcloud&gt;\r\n<\/pre>\n<p><strong>Code preview (classic mode):<\/strong><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-soundcloud-classic.jpg\" width=\"700\" height=\"150\" alt=\"AMP SoundCloud Classic Mode\"><\/figure>\n<h3>Visual Mode<\/h3>\n<p>In <code>Visual Mode<\/code>, the featured image spans behind the audio player. Here, you can also find the proper <code>height<\/code> belonging to Visual Mode in the Embed code on SoundCloud.com.<\/p>\n<p><strong>Code example (visual mode):<\/strong><\/p>\n<pre>\r\n&lt;amp-soundcloud height=\"450\" layout=\"fixed-height\"\r\n    data-trackid=\"264419072\" data-visual=\"true\"&gt;\r\n&lt;\/amp-soundcloud&gt;\r\n<\/pre>\n<p><strong>Code example (visual mode):<\/strong><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-soundcloud-visual.jpg\" width=\"700\" height=\"409\" alt=\"AMP SoundCloud Example Visual Mode\"><\/figure>\n<p>If you want to <strong>embed a private audio<\/strong>, use the optional <code>data-secret-token<\/code> attribute.<\/p>\n<p><strong>Script to include:<\/strong><\/p>\n<pre>\r\n&lt;script async custom-element=\"amp-soundcloud\"\r\n    src=\"https:\/\/cdn.ampproject.org\/v0\/amp-soundcloud-0.1.js\"&gt;\r\n&lt;\/script&gt;\r\n<\/pre>\n<p class=\"note\">Check out some examples on how to properly use <code>&lt;amp-soundcloud&gt;<\/code> <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/examples\/soundcloud.amp.html\" target=\"_blank\" rel=\"noopener\">on Github<\/a>.<\/p>\n<h2>6. <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-vine\/amp-vine.md\" target=\"_blank\" rel=\"noopener\"><code>amp-vine<\/code><\/a><\/h2>\n<p><a href=\"https:\/\/vine.co\/\" target=\"_blank\" rel=\"noopener\">Vine<\/a> is a short-form video sharing site on which you can share 6-second long videos with your friends. The <code>&lt;amp-vine&gt;<\/code> component makes it possible to easily <strong>embed Vine videos<\/strong> into your AMP HTML pages.<\/p>\n<p>This AMP component is quite simple, you only need to add the dimensions, and the ID of the Vine video in the <code>data-vineid<\/code> attribute. You can get the ID from the URL of each Vine.<\/p>\n<p>As Vines are squares, if you use the responsive layout, the same rule applies as with Instagram embeds; you can add any value to the <code>width<\/code> and <code>height<\/code> attributes, <strong>until they\u2019re equal<\/strong> they\u2019ll properly work.<\/p>\n<p><strong>Code example:<\/strong><\/p>\n<pre>\r\n&lt;amp-vine width=\"400\" height=\"400\"\r\n    layout=\"responsive\" data-vineid=\"hKQjlJPtWKT\"&gt;\r\n&lt;\/amp-vine&gt;\r\n<\/pre>\n<p><strong>Code preview:<\/strong><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-vine-example.jpg\" width=\"400\" height=\"400\" alt=\"AMP Vine Example\"><\/figure>\n<p><strong>Script to include:<\/strong><\/p>\n<pre>\r\n&lt;script async custom-element=\"amp-vine\"\r\n    src=\"https:\/\/cdn.ampproject.org\/v0\/amp-vine-0.1.js\"&gt;\r\n&lt;\/script&gt;\r\n<\/pre>\n<p class=\"note\">Take a look at the <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/examples\/vine.amp.html\" target=\"_blank\" rel=\"noopener\">Github examples<\/a> related to the <code>&lt;amp-vine&gt;<\/code> component.<\/p>\n<h2>7. <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-youtube\/amp-youtube.md\" target=\"_blank\" rel=\"noopener\"><code>amp-youtube<\/code><\/a><\/h2>\n<p>You can <strong>embed YouTube videos<\/strong> on AMP pages with the help of the <code>&lt;amp-youtube&gt;<\/code> component.<\/p>\n<p>To do so, you need to add the dimensions, plus the ID of the video in the <code>data-videoid<\/code> attribute. When specifying <code>width<\/code> and <code>height<\/code>, it\u2019s important to <strong>pay attention to the aspect ratio<\/strong>.<\/p>\n<p>You can also <strong>use the <a href=\"https:\/\/developers.google.com\/youtube\/player_parameters#parameters\" target=\"_blank\" rel=\"noopener\">parameters of YouTube embeds<\/a><\/strong> in AMP documents, just insert the name of the parameter <strong>after the <code>data-param-<\/code> prefix<\/strong>.<\/p>\n<p><strong>Code example:<\/strong><\/p>\n<p>In this example, I made use of the <code>start<\/code> YouTube parameter in the <code>data-param-start<\/code> attribute in order to make the video begin at 43s.<\/p>\n<pre>\r\n  &lt;amp-youtube width=\"480\" height=\"270\" layout=\"responsive\"\r\n      data-videoid=\"n0PVwYoKQmo\" data-param-start=\"43\"&gt;\r\n  &lt;\/amp-youtube&gt;\r\n<\/pre>\n<p><strong>Code preview:<\/strong><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-youtube-example.jpg\" width=\"550\" height=\"308\" alt=\"AMP Example Youtube\"><\/figure>\n<p><strong>Script to include:<\/strong><\/p>\n<pre>\r\n&lt;script async custom-element=\"amp-youtube\"\r\n    src=\"https:\/\/cdn.ampproject.org\/v0\/amp-youtube-0.1.js\"&gt;\r\n&lt;\/script&gt;\r\n<\/pre>\n<p class=\"note\">The <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/examples\/youtube.amp.html\" target=\"_blank\" rel=\"noopener\">Github examples<\/a> show different ways to embed Youtube videos on Accelerated Mobile Pages.<\/p>\n<h3>Other Video Sharing Services<\/h3>\n<p>AMP also has components related to other video sharing services, that <strong>work similarly to <code>&lt;amp-youtube&gt;<\/code><\/strong>. You can use the following extended AMP components for video embeds from providers other than YouTube:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-vimeo\/amp-vimeo.md\" target=\"_blank\" rel=\"noopener\"><code>&lt;amp-vimeo&gt;<\/code><\/a> for Vimeo embeds<\/li>\n<li><a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-dailymotion\/amp-dailymotion.md\" target=\"_blank\" rel=\"noopener\"><code>&lt;amp-dailymotion&gt;<\/code><\/a> for Dailymotion embeds<\/li>\n<li><a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-brightcove\/amp-brightcove.md\" target=\"_blank\" rel=\"noopener\"><code>&lt;amp-brightcove&gt;<\/code><\/a> for Brightcove embeds<\/li>\n<\/ul>\n<h2>8. <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-social-share\/amp-social-share.md\" target=\"_blank\" rel=\"noopener\"><code>amp-social-share<\/code><\/a><\/h2>\n<p>Apart from social media embeds, you can also <strong>display social share buttons<\/strong> on your AMP pages by using the <code>&lt;amp-social-share&gt;<\/code> component.<\/p>\n<p>The social share feature is <strong>preconfigured for <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-social-share\/amp-social-share.md#pre-configured-providers\" target=\"_blank\" rel=\"noopener\">some providers<\/a><\/strong>, but with the right settings you can use the <code>&lt;amp-social-share&gt;<\/code> component for any other social share buttons.<\/p>\n<h3>Pre-Configured Share Buttons<\/h3>\n<p><strong>Pre-configured share buttons<\/strong> don\u2019t require too many settings; you have to define the <code>width<\/code> (default is 60px) and <code>height<\/code> (default is 44px) attributes, and the name of the social media provider in the <code>type<\/code> attribute.<\/p>\n<p>With Facebook, you\u2019re also required to specify the <a href=\"https:\/\/developers.facebook.com\/apps\" target=\"_blank\" rel=\"noopener nofollow\">Facebook app id<\/a> in the <code>data-param-app_id<\/code> attribute.<\/p>\n<p><strong>Code example:<\/strong><\/p>\n<pre>\r\n&lt;div&gt;\r\n  &lt;!-- Facebook --&gt;\r\n  &lt;amp-social-share type=\"facebook\" width=\"60\" height=\"44\"\r\n      data-param-app_id=\"254325784911610\"&gt;\r\n  &lt;\/amp-social-share&gt;\r\n\r\n  &lt;!-- Twitter --&gt;\r\n  &lt;amp-social-share type=\"twitter\" width=\"60\" height=\"44\"&gt;\r\n  &lt;\/amp-social-share&gt;\r\n\r\n  &lt;!-- Google Plus --&gt;\r\n  &lt;amp-social-share type=\"gplus\" width=\"60\" height=\"44\"&gt;\r\n  &lt;\/amp-social-share&gt;\r\n\r\n  &lt;!-- Pinterest --&gt;\r\n  &lt;amp-social-share type=\"pinterest\" width=\"60\" height=\"44\"&gt;\r\n  &lt;\/amp-social-share&gt;\r\n\r\n  &lt;!-- Linkedin --&gt;\r\n  &lt;amp-social-share type=\"linkedin\" width=\"60\" height=\"44\"&gt;\r\n  &lt;\/amp-social-share&gt;\r\n\r\n  &lt;!-- Email --&gt;\r\n  &lt;amp-social-share type=\"email\" width=\"60\" height=\"44\"&gt;\r\n  &lt;\/amp-social-share&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p><strong>Code preview:<\/strong><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-social-share.jpg\" width=\"450\" height=\"96\" alt=\"AMP Social Share Example\"><\/figure>\n<p>The <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-social-share\/0.1\/amp-social-share-config.js\" target=\"_blank\" rel=\"noopener\">pre-configuration<\/a> <strong>makes assumptions<\/strong> that the URL you want to share is the canonical URL of the current page, and the text you want to include in your share is the page title.<\/p>\n<p>If you want to use another config, you can do that with the following <strong>three optional attributes<\/strong>:<\/p>\n<ol>\n<li><code>data-text<\/code> for the text you want to include in the share<\/li>\n<li><code>data-url<\/code> for the URL you want to share<\/li>\n<li><code>data-attribution<\/code> for the name of the person or provider you want your share to be attributed to<\/li>\n<\/ol>\n<h3>Unconfigured Share Buttons<\/h3>\n<p>To display social share buttons of <strong>unconfigured providers<\/strong>, such as WhatsApp, you need to <strong>specify the custom protocol of the provider<\/strong> in the <code>data-share-endpoint<\/code> attribute. Check out <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/extensions\/amp-social-share\/amp-social-share.md#un-configured-providers\" target=\"_blank\" rel=\"noopener\">in the docs<\/a> how you can do this.<\/p>\n<p><strong>Script to include:<\/strong><\/p>\n<pre>\r\n&lt;script async custom-element=\"amp-social-share\"\r\n    src=\"https:\/\/cdn.ampproject.org\/v0\/amp-social-share-0.1.js\"&gt;\r\n&lt;\/script&gt;\r\n<\/pre>\n<p class=\"note\">Check out  <a href=\"https:\/\/github.com\/ampproject\/amphtml\/blob\/main\/examples\/social-share.amp.html\" target=\"_blank\" rel=\"noopener\">Github examples<\/a> that can help you properly configure your social share buttons.<\/p>","protected":false},"excerpt":{"rendered":"<p>The biggest conflict that Google\u2019s mobile web standard, Accelerated Mobile Pages needs to solve is making mobile sites faster, while keeping them functional &#038; rich in content. These days rich and engaging content can hardly be imagined without embeds from popular social media sites \u2014 tweets, videos, audios, posts, photos. Extended AMP Components \u2014 among&hellip;<\/p>\n","protected":false},"author":146,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3399],"tags":[3882,37,4646],"topic":[4521],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>8 AMP Components for Social Media Integration - Hongkiat<\/title>\n<meta name=\"description\" content=\"The biggest conflict that Google&#039;s mobile web standard, Accelerated Mobile Pages needs to solve is making mobile sites faster, while keeping them\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"8 AMP Components for Social Media Integration\" \/>\n<meta property=\"og:description\" content=\"The biggest conflict that Google&#039;s mobile web standard, Accelerated Mobile Pages needs to solve is making mobile sites faster, while keeping them\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-24T15:01:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-13T11:41:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-facebook-example.jpg\" \/>\n<meta name=\"author\" content=\"Anna Monus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anna Monus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/\"},\"author\":{\"name\":\"Anna Monus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/a601053a0ab457901e00cdc83bd5359e\"},\"headline\":\"8 AMP Components for Social Media Integration\",\"datePublished\":\"2016-08-24T15:01:25+00:00\",\"dateModified\":\"2022-07-13T11:41:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/\"},\"wordCount\":2008,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/amp-components-social-media\\\/amp-facebook-example.jpg\",\"keywords\":[\"Accelerated Mobile Pages\",\"Google\",\"Mobile Website Design &amp; Dev\"],\"articleSection\":[\"Mobile\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/\",\"name\":\"8 AMP Components for Social Media Integration - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/amp-components-social-media\\\/amp-facebook-example.jpg\",\"datePublished\":\"2016-08-24T15:01:25+00:00\",\"dateModified\":\"2022-07-13T11:41:59+00:00\",\"description\":\"The biggest conflict that Google's mobile web standard, Accelerated Mobile Pages needs to solve is making mobile sites faster, while keeping them\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/amp-components-social-media\\\/amp-facebook-example.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/amp-components-social-media\\\/amp-facebook-example.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/amp-components-social-media\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"8 AMP Components for Social Media Integration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/a601053a0ab457901e00cdc83bd5359e\",\"name\":\"Anna Monus\",\"description\":\"Anna is Technical Editor and Writer for Hongkiat.com. She mainly covers front-end frameworks, web standards, accessibility, WordPress development, and UX design.\",\"sameAs\":[\"https:\\\/\\\/www.annalytic.com\\\/\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/anna_monus\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"8 AMP Components for Social Media Integration - Hongkiat","description":"The biggest conflict that Google's mobile web standard, Accelerated Mobile Pages needs to solve is making mobile sites faster, while keeping them","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/","og_locale":"en_US","og_type":"article","og_title":"8 AMP Components for Social Media Integration","og_description":"The biggest conflict that Google's mobile web standard, Accelerated Mobile Pages needs to solve is making mobile sites faster, while keeping them","og_url":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2016-08-24T15:01:25+00:00","article_modified_time":"2022-07-13T11:41:59+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-facebook-example.jpg","type":"","width":"","height":""}],"author":"Anna Monus","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Anna Monus","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/"},"author":{"name":"Anna Monus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/a601053a0ab457901e00cdc83bd5359e"},"headline":"8 AMP Components for Social Media Integration","datePublished":"2016-08-24T15:01:25+00:00","dateModified":"2022-07-13T11:41:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/"},"wordCount":2008,"commentCount":0,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-facebook-example.jpg","keywords":["Accelerated Mobile Pages","Google","Mobile Website Design &amp; Dev"],"articleSection":["Mobile"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/","url":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/","name":"8 AMP Components for Social Media Integration - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-facebook-example.jpg","datePublished":"2016-08-24T15:01:25+00:00","dateModified":"2022-07-13T11:41:59+00:00","description":"The biggest conflict that Google's mobile web standard, Accelerated Mobile Pages needs to solve is making mobile sites faster, while keeping them","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-facebook-example.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/amp-components-social-media\/amp-facebook-example.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/amp-components-social-media\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"8 AMP Components for Social Media Integration"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/a601053a0ab457901e00cdc83bd5359e","name":"Anna Monus","description":"Anna is Technical Editor and Writer for Hongkiat.com. She mainly covers front-end frameworks, web standards, accessibility, WordPress development, and UX design.","sameAs":["https:\/\/www.annalytic.com\/"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/anna_monus\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-7es","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/27804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/146"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=27804"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/27804\/revisions"}],"predecessor-version":[{"id":60404,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/27804\/revisions\/60404"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=27804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=27804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=27804"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=27804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}