EMBEDPARAM
Retrieves a custom parameter passed to your embedded form or calculator. Use EMBEDPARAM to personalize experiences based on data from the embedding page.
Syntax
EMBEDPARAM("key")Parameters:
key(String) – The name of the parameter to retrieve
Returns: The parameter value as text, or empty if not found.
How it works
When you embed a ConvertSite form or calculator on your website, you can pass custom parameters through the embed code. EMBEDPARAM reads those parameters in your formulas.
The function only works in embedded contexts. If you use it in a standalone page or preview, it returns an error.
Adding parameters to your embed
Add custom parameters as attributes on your embed container:
<div class="convertsite-embed"
data-id="YOUR_FORM_ID"
data-country="US"
data-campaign="summer-sale"
data-referral-code="SUMMER2024">
</div>
<script src="https://scripts.convertsite.com/embed.js"></script>Each data-* attribute becomes a parameter you can read with EMBEDPARAM.
Reading parameters in formulas
EMBEDPARAM("country") // Returns "US"
EMBEDPARAM("campaign") // Returns "summer-sale"
EMBEDPARAM("referral-code") // Returns "SUMMER2024"Key matching rules
Case-insensitive:
EMBEDPARAM("Country")andEMBEDPARAM("country")both workOptional
data-prefix: You can include or omitdata-in the key name — bothEMBEDPARAM("country")andEMBEDPARAM("data-country")return the same valueUnderscores and hyphens are equivalent:
EMBEDPARAM("referral_code")matchesdata-referral-codeValue is case-sensitive: The returned value preserves the exact case from the embed
Examples
Personalize pricing by region
IF(EMBEDPARAM("region") = "EU",
PRICE * 1.21, // Add EU VAT
PRICE) // No tax for other regionsApply referral discounts
IF(EMBEDPARAM("referral") = "PARTNER50",
TOTAL * 0.5, // 50% partner discount
TOTAL)Show targeted content
IF(ISEMPTY(EMBEDPARAM("campaign")),
"Welcome!",
CONCAT("Welcome, ", EMBEDPARAM("campaign"), " visitor!"))Handle missing parameters
IF(ISEMPTY(EMBEDPARAM("discount")),
PRICE, // No discount code
PRICE * (1 - EMBEDPARAM("discount"))) // Apply discountTips
EMBEDPARAM only works when your form is embedded on another website. It will not work in preview mode or on standalone ConvertSite pages.
Use
ISEMPTY(EMBEDPARAM("key"))to check if a parameter exists before using itCombine with
IFto provide fallback values when parameters are missingPass UTM parameters, user IDs, or session data from your CMS to personalize forms
Common mistakes
Using the function in preview: EMBEDPARAM only works in live embeds, not in the ConvertSite editor or preview
Forgetting quotes: The key must be a text string:
EMBEDPARAM("country")notEMBEDPARAM(country)Expecting a default value: EMBEDPARAM returns empty when a parameter is missing, not an error — use
IForIFERRORto handle this
See also
GET · IF · ISEMPTY · FormulaScript Overview