Skip to content

Latest commit

 

History

History
96 lines (68 loc) · 4.01 KB

ANALYZERS.md

File metadata and controls

96 lines (68 loc) · 4.01 KB

Analyzers

The bundle uses a set of analyzers to analyze Rich Text Contents and Content Preview.

An analyzer extends the Codein\IbexaSeoToolkit\Analysis\AbstractAnalyzer abstract class.

From here, you have two main options:

  • Use the set of analyzers provided by the bundle.
  • Implement some analyzers yourself. (After all, Symfony offers great tooling for extending bundles)

Details

Philosophy

The goal of analyzers is to provide good intel of whether the writing strategy is adapted to the focus keyword we want to rank on. (a.k.a. Keyword analysis)

For example, if we want to rank for "Ibexa Bundle", it make sense to use this keyword in some h2 titles, in the text.

Moreover, another goal is to help content creators to write content which will be read well by both search engines and the customer (a.k.a. Lisibility analysis).

Data analytics

Analyzers uses data configured:

  • Rich text field (at writing time)
  • Content preview (requires at least to save the content to get up to date insight)
  • Keyword text field (contributed in the content edit view)
  • Is this a pillar content or not (contributed in the content edit view)

Analyzers available

At the moment there are several available analyzers:

Word Count Analyzer

  • Class: Codein\IbexaSeoToolkit\Analysis\Analyzers\WordCountAnalyzer
  • Data context: Rich text data
  • Role : It will count the number of words in all Rich Text fields configured.
  • Scores :
    • Low : if text content < 700 words
    • Medium : if 700 <= text content < 1500 words
    • High : if 1500 < text content
  • Notes : if the content is a pillar content, number of words requirements will be raised by a factor of 1.5.

Keyword In Titles Analyzer

  • Class: Codein\IbexaSeoToolkit\Analysis\Analyzers\KeywordInTitlesAnalyzer
  • Data context: Rich text data
  • Role : It will check if the keyword is present in (h1|h2|h3|h4|h5|h6) titles.
  • Scores :
    • Low : if keyword is present in less than 10% of titles
    • Medium : if keyword is present in more than 10% and less than 30% of titles.
    • High : if keyword is present in more than 30% of titles.

Keyword In Url Slug Analyzer

  • Class: Codein\IbexaSeoToolkit\Analysis\Analyzers\KeywordInUrlSlugAnalyzer
  • Data context: Url slug via locationId
  • Role : It will check if the keyword is present in the url alias (= url slug).
  • Scores :
    • Low : if keyword is not present in the slug
    • Medium : if keyword is present, but does not match the slug exactly
    • High : if keyword matches exactly the slug

Title Tag Contains Keyword Analyzer

  • Class: Codein\IbexaSeoToolkit\Analysis\Analyzers\TitleTagContainsKeywordAnalyzer
  • Data context: Content Preview
  • Role : It will check if the keyword is present in the title tag (= <title></title>).
  • Scores :
    • Low : if no title tag is in the DOM
    • Medium : if the title text does not contain the keyword
    • High : if the title text contains the keyword

One H1 Tag Maximum Analyzer

  • Class: Codein\IbexaSeoToolkit\Analysis\Analyzers\OneH1TagMaximumAnalyzer
  • Data context: Content Preview
  • Role : It will check if the article has exactly one h1 tag.
  • Scores :
    • Low : No h1 tag or more than one.
    • High : 1 h1 tag

Create a custom analyzer

To create a custom analyzer, simply extend Codein\IbexaSeoToolkit\Analysis\AbstractAnalyzer class and in the analyze method of your class return the result.

You can get inspiration on how to proceed by looking at existing analysis classes.

By extending AbstractAnalyzer, your service should automatically be tagged : codein_ibexa_seo_toolkit.seo_analyzer

If that's not the case, know that it's required for your analysis class to be taken into account.

That's it!

Check out the docs for information on how to use the bundle! Return to the index.