Getting started with Cards (2024)

Getting Started Guide

  1. Getting Started with Cards
  2. Card and Content Attribution
  3. Card Display
  4. Multiple URLs in a Tweet
  5. Twitter Cards and Open Graph

Getting Started with Cards

To get started with implementing Cards markup, specify the type of card for your content by adding the following HTML markup to the HEAD section of the page:

<meta name="twitter:card" content="summary"></meta>

Card properties are simple key-value pairs, each defined in an HTML meta tag as seen above. The combined collection of properties defines the overall card experience on Twitter, and each card type supports and requires a specific set of properties.

All cards have one basic property in common - the card type value:

Card PropertyDescription
twitter:cardThe card type, which will be one of “summary”, “summary_large_image”, “app”, or “player”.

Only one card type per-page is supported. If more than one twitter:card value exists in the page, the “last” one in sequence will take priority.

Card and Content Attribution

Each card has built-in content attribution, which surfaces appropriate Twitter accounts for the content as specified by you. Users will be able to follow and view the profiles of attributed accounts directly from the card. There are two kinds of attribution:

Website Attribution: Indicates the Twitter account for the website or platform on which the content was published. Note that a service may set separate Twitter accounts for different pages/sections of their website, and the most appropriate Twitter account should be used to provide the best context for the user. For example, nytimes.com may set the the website attribution to “@nytimes” for front page articles, and “@NYTArts” for articles in the Arts & Entertainment section.

Creator Attribution: Indicates the individual user that created the content within the card. This applies to the Summary with Large Image card.

Configure card attribution using the following properties:

Card PropertyDescriptionRequired
twitter:site@username for the website used in the card footer.No
twitter:creator@username for the content creator / author.No

URL Crawling & Caching

Twitter’s crawler respects Google’s robots.txt specification when scanning URLs. If a page with card markup is blocked, no card will be shown. If an image URL is blocked, no thumbnail or photo will be shown.

Twitter uses the User-Agent of Twitterbot (with version, such as Twitterbot/1.0), which can be used to create an exception in the robots.txt file.

For example, here is a robots.txt which disallows crawling for all robots, except Twitter’s fetcher:

User-agent: TwitterbotDisallow:User-agent: *Disallow: /

Here is another example, which specifies which directories are allowed to be crawled by Twitterbot (in this case, disallowing all except the images and archives directories):

User-agent: TwitterbotDisallow: *Allow: /imagesAllow: /archives

The server’s robots.txt file must be saved as plain text with ASCII character encoding. To verify this, run the following command:

$ file -I robots.txtrobots.txt: text/plain; charset=us-ascii

Content is cached by Twitter for 7 days after a link to a page with card markup has been published in a Tweet.

If you encounter issues with cards in Tweets not appearing properly, see the Cards Troubleshooting Guide.

Card Display

Twitter Cards generated from meta tags only appear when a Tweet is either expanded in the timeline (on web) or viewed on the Tweet’s individual permalink page (by clicking on the date from the timeline, either on web or on mobile).

In limited circ*mstances, Cards may appear in the timeline, such as in images posted to Twitter, Ad formats, and Twitter-run experiments.

If you are looking to bring media (photos, videos and Cards) into the timeline, consider one of the following options:

  • Accounts can pin a Tweet to the top of their timeline, which auto-expands the Tweet and displays the Card. (This is possible on web only.).
  • For photos and animated GIFs, upload the media directly with the Tweet or consider using the Twitter API to upload media.
  • For Ad formats with a call-to-action, visit Twitter Ads for Website Cards.

Multiple URLs in a Tweet

In some circ*mstances, users may want to Tweet multiple URLs. Only one card may be shown in a Tweet. Here is the order of precedence when processing multiple URLs:

  1. Images or media attached to Tweets will have precedence over any card attached to a URL.
  2. URLs with cards are processed in order of appearance in the Tweet, first to last

Twitter Cards and Open Graph

Twitter card tags look similar to Open Graph tags, and are based on the same conventions as the Open Graph protocol. When using Open Graph protocol to describe data on a page, it is easy to generate a Twitter card without duplicating tags and data. When the Twitter card processor looks for tags on a page, it first checks for the Twitter-specific property, and if not present, falls back to the supported Open Graph property. This allows for both to be defined on the page independently, and minimizes the amount of duplicate markup required to describe content and experience.

Note that while Open Graph recommends specifying the “og” RDFa Core 1.1 CURIE prefix mapping via <html prefix="og: http://ogp.me/ns#">, no such markup is required for Twitter cards and its use of the twitter: prefix in a HTML meta element’s name attribute. Open Graph protocol also specifies the use of property and content attributes for markup (<meta property="og:image" content="http://example.com/ogp.jpg"/>) while Twitter cards use name and content. Twitter’s parser will fall back to using property and content, so there is no need to modify existing Open Graph protocol markup if it already exists.

The example below uses a mix of Twitter and Open Graph tags to define a summary card:

<meta name="twitter:card" content="summary" /><meta name="twitter:site" content="@nytimesbits" /><meta name="twitter:creator" content="@nickbilton" /><meta property="og:url" content="http://bits.blogs.nytimes.com/2011/12/08/a-twitter-for-my-sister/" /><meta property="og:title" content="A Twitter for My Sister" /><meta property="og:description" content="In the early days, Twitter grew so quickly that it was almost impossible to add new features because engineers spent their time trying to keep the rocket ship from stalling." /><meta property="og:image" content="http://graphics8.nytimes.com/images/2011/12/08/technology/bits-newtwitter/bits-newtwitter-tmagArticle.jpg" />
Getting started with Cards (2024)
Top Articles
Last Epoch: Why Keystroke Registration Issues Are Frustrating Players
Last Epoch Performance Issues: A Community Frustration
7 C's of Communication | The Effective Communication Checklist
Duralast Gold Cv Axle
Section 4Rs Dodger Stadium
Dricxzyoki
Ffxiv Palm Chippings
Fort Carson Cif Phone Number
Northern Whooping Crane Festival highlights conservation and collaboration in Fort Smith, N.W.T. | CBC News
The Best English Movie Theaters In Germany [Ultimate Guide]
Waive Upgrade Fee
Urinevlekken verwijderen: De meest effectieve methoden - Puurlv
Garrick Joker'' Hastings Sentenced
Which Is A Popular Southern Hemisphere Destination Microsoft Rewards
Learn2Serve Tabc Answers
Colts Snap Counts
Mills and Main Street Tour
Christina Khalil Forum
Midlife Crisis F95Zone
Eva Mastromatteo Erie Pa
History of Osceola County
Is Grande Internet Down In My Area
Edicts Of The Prime Designate
Rural King Credit Card Minimum Credit Score
Ford F-350 Models Trim Levels and Packages
Craigslist Dubuque Iowa Pets
Restaurants In Shelby Montana
Superhot Free Online Game Unblocked
Meowiarty Puzzle
Taktube Irani
Otis Offender Michigan
Vlocity Clm
UPS Drop Off Location Finder
404-459-1280
67-72 Chevy Truck Parts Craigslist
Are you ready for some football? Zag Alum Justin Lange Forges Career in NFL
The Vélodrome d'Hiver (Vél d'Hiv) Roundup
Admissions - New York Conservatory for Dramatic Arts
Leena Snoubar Net Worth
2023 Fantasy Football Draft Guide: Rankings, cheat sheets and analysis
Cl Bellingham
814-747-6702
Cuckold Gonewildaudio
Expendables 4 Showtimes Near Malco Tupelo Commons Cinema Grill
New Starfield Deep-Dive Reveals How Shattered Space DLC Will Finally Fix The Game's Biggest Combat Flaw
French Linen krijtverf van Annie Sloan
18443168434
Zom 100 Mbti
O.c Craigslist
Land of Samurai: One Piece’s Wano Kuni Arc Explained
Stone Eater Bike Park
Bellin Employee Portal
Latest Posts
Article information

Author: Frankie Dare

Last Updated:

Views: 5971

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Frankie Dare

Birthday: 2000-01-27

Address: Suite 313 45115 Caridad Freeway, Port Barabaraville, MS 66713

Phone: +3769542039359

Job: Sales Manager

Hobby: Baton twirling, Stand-up comedy, Leather crafting, Rugby, tabletop games, Jigsaw puzzles, Air sports

Introduction: My name is Frankie Dare, I am a funny, beautiful, proud, fair, pleasant, cheerful, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.