This article breaks down the key meta tags to understand and configure when attempting to share a piece of content from energy.gov to Social Networking sites.
June 11, 2021![Screenshot of Meta Tag Field in 'Edit' Tab](/sites/default/files/styles/full_article_width/public/2021-06/Screenshot_Meta%20Tags_0.png?itok=9CnPWs7P)
Social Media Sharing
Content posted on Energy.gov through the DOE CMS may be shared to Social Media pages. Meta tags give users the ability to control granular aspects of how the content will appear on search engines and social networking sites.
When creating content, there are seemingly endless metatag fields. We know this can be overwhelming! We have taken the time to explain the key metatag fields for social media sharing and their default values.
Configuring Meta Tags
- Create or open desired Content from the Content Library
- Select ‘Edit’
- See ‘Metatags' on the right side menu.
Tokens are strings that enable meta tag fields to pull directly from configured fields within the CMS
For example, entering [node:title] in the ‘title’ box would mean that when the article is shared to Facebook, the title would mirror that of the node on Energy.gov.
Helpful Hint: If you wish to change the default token, enter the desired value or token into the linked fields in the ‘Edit’ view (see key content meta tags below for details).
KEY CONTENT META TAGS
canonical_url
Default Token Source: [node:url] pulls from the url of the relevant page
Function: Links end users interacting with social media post back to the relevant piece of content.
Linked Fields: ‘canonical_url’, ‘shortlink’, ‘twitter_cards_page_url’
description
Default Token Source: [node:field_summary] pulls from the text entered into the ‘Summary’ field in the ‘Edit’ tab for an article or page
Function: May be used by search engines to display a concise summary of the page’s content in search results
Linked Fields: ‘description’, ‘og_description’, ‘twitter_cards_description’
image_src
Default Token Source: [node:field_alternative_thumbnail:entity:field_media_image:photo_gallery_509_x_678_] pulls from the thumbnail image added in the ‘Edit’ tab for a page or article
Function: Populates the thumbnail image that will represent content on social networking sites.
Linked Fields: ‘image_src’, ‘og_image’, ‘og_image_url’, ‘twitter_cards_image’
shortlink
Default Token Source: [node:url:unaliased] pulls from the url of the relevant page
(Note: Functions the same as [node:url] and [current-page:url:absolute)
Function: Links end users interacting with social media post back to the relevant piece of content.
Linked Fields: ‘canonical_url’, ‘shortlink’, ‘twitter_cards_page_url’
title
Default Token Source:
[node:title] pulls from the text entered under ‘Title’ in the ‘Edit’ tab for a given piece of content.
[site:name] pulls from the name of the site on which the content exists (i.e. Energy.gov)
Function: The text to display in the title bar of a visitor’s web browser when viewing this page, saving the page as a bookmark, or when viewing search engine results including this page.
Linked Fields: ‘title’, ‘twitter_cards_title’
og_description
See “description” above
og_image
See ‘image_src’ above
og_image_type
Default Token Source: [node:field_alternative_thumbnail:entity:field_media_image:mimetype] pulls from the ‘Thumbnail’ image field in the ‘Edit’ tab for a piece of content
Function: Populates a thumbnail image for the content on social networking sites
Linked Fields: ‘og_image_type’
og_image_url
See ‘image_src’ above
twitter_cards_description
Default Token Source: See ‘description’ above
Function: A concise summary of the article or page that could be displayed as a Tweet (Twitter post)
Linked Fields: ‘description’, ‘og_description’, ‘twitter_cards_description’
twitter_cards_image
Default Token Source: See ‘image_src’ above
Function: A thumbnail image to represent the content when shared to Twitter
Linked Fields: ‘image_src’, ‘og_image’, ‘og_image_url’, ‘twitter_cards_image’
twitter_cards_page_url
Default Token Source: [current-page:url:absolute] pulls from the url of the relevant page
(Note: Functions the same as [node:url] and [node:url:unaliased])
Function: Used to link end-users from a Tweet back to the original content or page.
Linked Fields: ‘twitter_cards_page_url’, ‘canonical url’, ‘shortlink’
twitter_cards_title
Default Token Source: [current-page:title] pulls from the text entered under ‘Title’ in the ‘Edit’ tab for a given piece of content.
Function: The title of the page to be displayed on Twitter, capped at 70 characters.
Linked Fields: ‘twitter_cards_title’, ‘title’