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 :
- Click on the "Add a variable" button.
- Select "Global".
- Enter the name of your variable in the "Variable name" field. Use only alphanumeric characters, no special characters or spaces in your variable name.
- ✅ Examples of valid variable names: MaVariable2 | variable | Couleur | couleurProduit | elementProduit
- ❌ Examples of invalid variables: My variable | My-variable | Product color | Product item
- Enter the contents of your variable in the "Element" field.
- 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 :
- Click on the "Add a variable" button.
- Select "Text".
- Enter the name of your variable in the "Variable name" field. Use only alphanumeric characters, no special characters or spaces in your variable name.
- ✅ Examples of valid variable names: MaVariable2 | variable | Couleur | couleurProduit | elementProduit
- ❌ Examples of invalid variables: My variable | My-variable | Product color | Product item
- Target the HTML tag whose text you want to retrieve using a CSS selector. (💡 How to find the CSS selector with Automa)
- Enter the CSS selector in the "CSS Selector" field.
- 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:
- "Variable name: couleurProduit
- "CSS selector: span.color
- "Element": Text
- 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 :
- Click on the "Add a variable" button.
- Select "Attribute".
- Enter the name of your variable in the "Variable name" field. Use only alphanumeric characters, no special characters or spaces in your variable name.
- ✅ Examples of valid variable names: MaVariable2 | variable | Couleur | couleurProduit | elementProduit
- ❌ Examples of invalid variables: My variable | My-variable | Product color | Product item
- Target the HTML tag whose attribute value you wish to retrieve using a CSS selector. (💡 How to retrieve a CSS selector with Automa)
- Enter the CSS selector in the "CSS Selector" field.
- 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:
- "Variable name: couleurProduit
- "CSS selector: span.color
- "Element": data-attribute-color
- Utiliser la syntaxe {{ couleurProduit }} pour ajouter « rouge » dans une recette SEO : Pull {{ couleurProduit }} = Pull rouge