Prepare your content
Learn how to optimize your website content for accurate scraping and topic extraction by using data attributes and meta tags in Optimizely Content Recommendations.
You can improve the quality of scraped content by using data-epi-type attributes to control what gets extracted, and meta tags to provide additional metadata.
Annotate your content with data-epi-type attributes
data-epi-type attributesUse data-epi-type attributes to specify which elements the scraper should extract. This helps exclude navigation, footers, and other non-article content from topic analysis.
data-epi-type="title"– Marks the primary titledata-epi-type="content"– Marks the main body content
If you use multiple data-epi-type="content" blocks, they will be concatenated during extraction.
Example
<html>
<head>
<meta property="og:title" content="Getting Started with Content Recommendations" />
<meta property="og:description" content="Learn how to implement personalized content recommendations." />
</head>
<body>
<header>Site navigation - excluded from extraction</header>
<h1 data-epi-type="title">Getting Started with Content Recommendations</h1>
<div data-epi-type="content">
<p>This is the main article content that will be analyzed.</p>
<p>All paragraphs within this div are included for topic extraction.</p>
</div>
<footer>Footer content - excluded from extraction</footer>
</body>
</html>
NoteMeta tags are collected separately from
data-epi-typeattributes. Both extraction methods work independently.
Provide metadata with meta tags
The scraper collects meta tags from your pages for content categorization and rendering in recommendation widgets.
Open Graph tags
The following Open Graph tags are supported:
og:title– Page titleog:description– Page descriptionog:image– Primary image URLog:image:secure_url– Secure image URL variantog:image:alt– Image alt textog:locale– Content localeog:region– Geographic regionog:type– Content typeog:url– Canonical URL
NoteThe tag
og:image:altis stored asog:image_alt.
Article tags
All tags starting with article: are collected. Common tags include:
article:published_time– Publication date (must be ISO 8601 format with a timezone)article:category– Content categoryarticle:tag– Content tags (you can have multiple)
Custom tags
All tags starting with idio: are collected. Use the following for custom metadata:
<meta property="idio:author_id" content="12345" />
<meta property="idio:content_tier" content="premium" />Nested fields
idio:* and article:* tags support nested fields. For example, idio:content:category is stored as metadata.idio.content.category.
Multiple meta tags with the same property are stored as an array, including the following example:
<meta property="idio:content:category" content="Technology">
<meta property="idio:content:category" content="Software Development">This is stored as the following:
{"idio": {"content": {"category": ["Technology", "Software Development"]}}}A field cannot be used both as a direct value and as a container for nested fields. For example, if you set idio:content:tier to premium, you cannot also use idio:content:tier:category because tier is already assigned a value.
NoteArticle and custom tags work with both
propertyandnameattributes.
Example
<meta property="og:title" content="How to Optimize Content Recommendations" />
<meta property="og:description" content="Best practices for content recommendations." />
<meta property="og:image" content="https://www.example.com/images/guide.jpg" />
<meta property="article:published_time" content="2025-02-03T15:19:00.000-05:00" />
<meta property="article:category" content="Technology" />
<meta property="article:tag" content="Content Recommendations" />
<meta property="article:tag" content="Personalization" />
<meta property="idio:author_id" content="12345" />
<meta property="idio:content_tier" content="premium" />Updated 1 day ago
