Menu

SEO recommendation - Variables

Variables are used in the "SEO Recommendation" application. The variable concept allows you to retrieve an element from the HTML code of your page for use in an "SEO Recipe". For example, you can retrieve the color of a product and modify your title tag with this variable.

The video tutorial

[🎥 Video coming soon]

How does it work?

When you're at the variable creation stage in the "SEO Recommendation" application, click on the "Add a variable" button.

We propose 3 types of variables.

Global variable

A "global" variable is used to associate a fixed value with a variable.

A "global" variable is accessible in all the "SEO recipes" of the SEO recommendation.

To configure a "global" variable :

  1. Click on the "Add a variable" button.
  2. Select "Global".
  3. Enter the name of your variable in the "Variable name" field. Use only alphanumeric characters, no special characters or spaces in your variable name.
    1. ✅ Examples of valid variable names: MaVariable2 | variable | Couleur | couleurProduit | elementProduit
    2. ❌ Examples of invalid variables: My variable | My-variable | Product color | Product item
  4. Enter the contents of your variable in the "Element" field.
  5. Pour utiliser votre variable dans une « recette SEO », utilisez la syntaxe suivante dans les formulaires de la « recette SEO » : {{ MaVariable }}

Text variable

A "text" variable is used to retrieve the text present in an HTML tag.

Par exemple, vous pouvez récupérer le texte « Vert » dans le code : <span class="color">Vert</span>

A "text" variable is accessible in the "SEO recipes" section of the SEO recommendation.

To configure a text variable :

  1. Click on the "Add a variable" button.
  2. Select "Text".
  3. Enter the name of your variable in the "Variable name" field. Use only alphanumeric characters, no special characters or spaces in your variable name.
    1. ✅ Examples of valid variable names: MaVariable2 | variable | Couleur | couleurProduit | elementProduit
    2. ❌ Examples of invalid variables: My variable | My-variable | Product color | Product item
  4. Target the HTML tag whose text you want to retrieve using a CSS selector. (💡 How to find the CSS selector with Automa)
  5. Enter the CSS selector in the "CSS Selector" field.
  6. Select the "Text" type in the Element field.

Example

I want to retrieve the color in the code below:

<span class="color">Vert</span>

Here's how to set up the fields:

  1. "Variable name: couleurProduit
  2. "CSS selector: span.color
  3. "Element": Text
  4. Utiliser la syntaxe {{ couleurProduit }} pour ajouter « Vert » dans une recette SEO : Pull {{ couleurProduit }} = Pull Vert

Attribute variable

An "attribute" variable is used to retrieve the value of an attribute in an HTML tag.

Par exemple, vous pouvez récupérer la valeur « rouge » dans le code : <span class="color" data-attribute="rouge">Rouge</span>

An "attribute" variable is accessible in all the "SEO recipes" of the SEO recommendation.

To configure an attribute variable :

  1. Click on the "Add a variable" button.
  2. Select "Attribute".
  3. Enter the name of your variable in the "Variable name" field. Use only alphanumeric characters, no special characters or spaces in your variable name.
    1. ✅ Examples of valid variable names: MaVariable2 | variable | Couleur | couleurProduit | elementProduit
    2. ❌ Examples of invalid variables: My variable | My-variable | Product color | Product item
  4. Target the HTML tag whose attribute value you wish to retrieve using a CSS selector. (💡 How to retrieve a CSS selector with Automa)
  5. Enter the CSS selector in the "CSS Selector" field.
  6. Enter the attribute name in the "Element" field.

Example

I want to retrieve the color in the code below:

<span class="color" data-attribut-color="rouge">Rouge</span>

Here's how to set up the fields:

  1. "Variable name: couleurProduit
  2. "CSS selector: span.color
  3. "Element": data-attribute-color
  4. Utiliser la syntaxe {{ couleurProduit }} pour ajouter « rouge » dans une recette SEO : Pull {{ couleurProduit }} = Pull rouge