🧠Understanding Scripts and Variables +
Introduction
Scripts and variables are important tools in Eversend that help fill in placeholders found in templates, such as landers, prelanders, and white pages. Placeholders are keywords inside double curly braces, like {{placeholder}}
, that need to be replaced with actual values to customize a template. This article will explain how scripts and variables work, how they are used, and how they make managing templates more efficient.
Scripts and Variables
In Eversend, both scripts and variables are used to replace placeholders in templates. The key difference between them lies in their use and how they are managed.
- Scripts: Scripts are identified by placeholders starting with
#
inside double curly braces, like{{#script_a}}
. Scripts are global resources, which means every workspace member has at least view access. Script placeholders in a template will automatically resolve against the current version of the script resource, making them easy to manage and update. For example, if a script is updated, all templates that use it will automatically reflect those updates. - Variables: Variables are identified by placeholders starting with
*
, such as{{*aff_id}}
. Unlike scripts, variables are not global resources and are not visible to all members by default. Variables are usually used to fill in details like affiliate IDs or credentials that may vary for each campaign. Variables are set when creating a traffic campaign. During the campaign setup, Eversend scans all chosen templates and prompts the user to enter values for each variable placeholder, ensuring all required information is provided.
How Placeholders Work
Placeholders are used in templates to mark where information will be inserted. These placeholders can either be for scripts or variables:
- Script Placeholders: When a template contains a script placeholder, it automatically pulls the current version of the script resource. This makes scripts a great way to apply standard functions or reusable pieces of code across multiple templates.
- Variable Placeholders: Variables, on the other hand, need to be filled in during campaign creation. This makes them more flexible and allows for customization specific to each campaign. For example, if a template requires an affiliate ID, the variable placeholder
{{*aff_id}}
will prompt the user to enter the correct value during setup.
Setting Variables During Campaign Creation
When creating a traffic campaign, Eversend scans the templates you have chosen and identifies any variable placeholders. You will then be prompted to provide the values for each variable. This ensures that all required details are filled in and your campaign is properly configured before it goes live.
Summary
Scripts and variables are key tools for managing and customizing templates in Eversend. Scripts are global and are used to automatically insert reusable code into templates, while variables are used to fill in specific details during campaign creation. Together, they help make the process of setting up campaigns more efficient and ensure that all necessary information is correctly applied to your templates.