Variables
Variables are a powerful feature in SmartFeeds that allow users to create reusable fields. These fields can be used in formulas across feeds, saving time and ensuring consistency. They also enable synchronization with channels, adapting data to specific target audiences or requirements. This guide explains how to create, manage, and optimize variables effectively.
Table of Contents
- What is a Variable?
- Managing Variables
- Using Variables in Visual Formula Editor
- Quick Answers to Common Issues
- Related Articles
What is a Variable?
A variable allows users to create additional fields that can be reused across SmartFeeds. For example, if a product catalog lists colors in English, but the target audience is French, a variable can be created to translate the color into French. This translated variable can then be used in titles, descriptions, or other relevant fields.
Variables also simplify workflows by reducing redundancy and enabling easy updates. For instance:
- Replace Color Names: Translate English color names into French for localized product titles and descriptions.
- Calculate ROAS (Return on Ad Spend): Combine revenue and ad spend into a single formula that can be reused across feeds to monitor performance metrics.
- Promotion Metadata: Centralize elements like brand, year, and promotion details into a single variable, simplifying updates and ensuring consistency across multiple feeds.
Managing Variables
Best Practices
- Build and Test First: Construct and test your variable in the formula editor before saving it. This step is critical to catch potential issues early, such as syntax errors or unexpected results. For example, if a formula references a non-existent field, the editor will flag it immediately, allowing you to fix the issue before it impacts your feed. This ensures correctness and reduces errors.
- Preview Results: Use the formula editor to preview the results before saving the variable, as the variable editor does not offer a preview feature.
Creating Variables
- Click on the "Create a variable" button.
- Provide a short and easily understandable name.
- Enter your formula.
- Click Save.
Example:
Create a variable named color_french
to translate colors from English to French. This variable can then be used in product titles and descriptions.
Editing Variables
- Click on the variable you want to edit.
- Update the formula as needed.
- Click Save.
Deleting Variables
- Click on the cross (X) next to the variable.
- Ensure the variable is not in use by checking the "use" section below the variable group.
- Click "Save"
Important: Deleting a variable that is still in use can cause errors. Make sure to remove it from formulas before deleting it.
Using Variables in Formula Editor
You can use the variables you created in the formula editor.
Simplified Variables
Some variables are created in the segmentation module (see Segmentation Guide) in a simplified form but can also be accessed and modified in their SQL form within the variable editor. These simplified variables are especially beneficial for non-technical users, as they offer an intuitive way to create and apply key metrics without needing SQL expertise.
For instance, users can easily track cumulative revenue or rank products by performance without exploring into complex formulas, while advanced users retain the flexibility to fine-tune these variables in SQL mode.
Available preset variables :
Variables created can be seamlessly integrated into the formula editor.
- Cumulative revenue : Tracks total revenue over a defined period, helping monitor performance metrics effectively.
In simple words : that's the total money earned over time. It shows how your business grows. - Ordinal Revenue: Ranks products based on revenue performance, making it easier to identify top-performing items.
In simple words: That's ranks products by revenue performance. It helps you quickly see which products make the most money. - ROAS: Calculates the return on ad spend, providing a critical metric for evaluating campaign success.
Variables created in the segmentation module can be used by everyone in all the editors.
Quick Answers to Common Issues
Can a variable error prevent updates?
If a variable contains an error, it blocks updates for any specific channel using that variable. However, this type of error cannot block the source catalog or the optimized feed.
Example of Errors: A common issue might be using an undefined variable in a formula or referencing a variable that has been deleted. To resolve this, check the "use" section to identify where the variable is applied and correct or replace the formula. Testing variables in the formula editor beforehand can help prevent such errors.
I canโt find the "use" of a variable?
Sometimes the "use" section is hidden due to scrolling. Ensure you scroll fully within the variable group view.
Related Articles
For further assistance with SmartFeeds, consider reviewing these articles:
For additional help, feel free to reach out via our Contact Us page.