Introduction
Welcome! This article will provide you with advanced settings for the variables, in order to match them with a tag.
After creating your variables and put them in the merchandising rules, it's essential to be sure that the information it will collect will match.
Prerequisites
Before we start, make sure you have access to the XO control panel. If you do not have access you can request access by clicking here or choosing “I/my colleague require access to an Attraqt service” from the use case drop down on the “Submit a request” page in the Support Centre. For security reasons we require access for 3rd parties to be requested by a member of the organisation to whos control panel access is being requested for. This is to ensure the individual has the organisations permission to access the control panel.
Important information
Each variable will collect information, it can be an ID, a category, a brand or every other information you need. To match, products in the catalog have to have a tag with the same information, if not, there can be a risk to not have any recommandation.
Every advanced settings you will apply on the variable has to be also applied on the tag settings.
We'll see different ways to match variables and tags:
- With the transformation
- With the "slug"
- With the prefix
Scenario 1: Match with a transformation
In the advanced settings of the variable, you can apply a transformation in order to adapt the wording of the information you will collect, it can be with UPPERCASE, Capitalize, lowercase or just with no transformation.
Scenario: We've created a product variable which collect the product apparel, we would like to see if it will match correctly with the tag.
Step 1
Go on theXO console, then in the 'Developers' menu, click on 'Variables'.
We've already configured the first part of the variable, we now go on the advanced settings below and put the uppercase transformation:
Now that we've applied the transformation on the variable, we will check if the tag has the same configuration.
Step 2
Go to the tag rules and look for the rules that allow us to have the apparel tag:
We've already have the transformation in UPPERCASE on the tag rule. We well have the same transformation in both elements.
Warning: If you change any settings on the tag, you will have to launch a tag recompute to apply the new modifications on the tags.
Also, if you variable or your tag is used on other widgets, be careful to not disrupt the other configurations.
Scenario 2: Match with a slug
The "slug" allows us to delete all the spaces and the special characters which can disrupt the match between the tag and the variable.
It can be used with the transformation, we recommend to.
Scenario: We'll take the same example that the first case. We've created a product variable which collect the product apparel, we would like to see if it will match correctly with the tag.
Step 1
Go on the XO console, then in the 'Developers' menu, click on 'Variables'.
We've already configured the first part of the variable, we now go on the advanced settings below and put the "slug":
Now that we've applied the slug on the variable, we will check if the tag has the same configuration.
Step 2
Go to the tag rules and look for the rules that allow us to have the apparel tag:
The slug was already put. We well have the same configuration.
Warning: If you change any settings on the tag, you will have to launch a tag recompute to apply the new modifications on the tags.
Also, if your variable or your tag is used on other widgets, be careful to not disrupt the other configurations.
Scenario 3: Match with a prefix
The prefix will permit to differentiate the information collected by the variable and the different tag we have. It's a information that we'll add to have a better understanding of the configuration.
For example, in the catalog, maybe I have two different levels of categories with the same name, it can be an issue if I want to filter only on the level 2 in my widget. In this case, it can use useful to add a prefix like "CAT1_" and "CAT2" to well differentiate them.
Scenario: We've created product variables for each levels of categories and we would like to put a prefix to be sure to well differentiate them.
Step 1
Go on the XO console, then in the 'Developers' menu, click on 'Variables'.
We've already configurated the first part of the variable, we now go on the advanced settings below and put the prefix.
Before writing the prefix, we have to put the symbol " ^ " on the regex field, in order to inform the variable that the prefix has to be before the information we'll collect.
Then, we can write the prefix we would like to have:
This way, if the variable collects the information "ROBE", we'll put the prefix automatically and we'll have "CAT1_ROBE".
Step 2
Go to the tag rules and look for the rules that allow to have the categories tag.
If we don't have any prefix, we can add it just by writing it on the field:
Warning: If you change any settings on the tag, you will have to launch a tag recompute to apply the new modifications on the tags.
Also, if you variable or your tag is used on other widgets, be careful to not disrupt the other configurations.
How can I check if the tag and the variable do match ?
Now that we've all configured, we'll see if it does match:
- To see how the variable is written, we can check it directly on the website, with XO Chrome extension.
- To see how the tag is written, I can check it in the catalog.
For example, we've created a product variable and applied an uppercase transformation and a slug on it. We'll see with Chrome extension if everything is does match correctly.
Step 1
Go to the website, on the page where we've applied the configuration, and activate the Chrome extension.
We have 2 ways to see the variable:
- On the first page with all the merchandising rules, we can switch between the variables and the values to see the variable applied and the information collected:
- On the fourth tag on the right, we can see all the variables applied with the information collected:
Step 2
Now that we know how the information is written by the variable $product_apparel, we'll check on the catalog if my products well have the good wording:
If yes, both elements will match and the merchandising rules will work. If not, we'll have to change the variable or the tag rule in order to make them match.
Summary
We've seen the 3 ways to do a match between tags and variables, but each of them can be applied together.
For a good match, we advise transforming them in uppercase, with a slug and a prefix if you can.
The prefix will mostly allow you to see quickly which information we have (for example for a tag B_SAMSUNG, with the B_ I know that we are looking about the brand).
Conclusion
Congratulations! You now know how to match a tag with a variable in XO.
Let us know in the comment section if there are other test scenarios you would like us to create how-to guides for.
Enjoy your XO experience 😊
Should you encounter any difficulty matching your variables of your own please don’t hesitate to contact us by clicking here or clicking the submit a case link on the Support Centre and choosing “I have a question” from the list of use cases.
Comments
0 comments
Please sign in to leave a comment.