Dynamic default variables for embeds

You can now parameterize an embedded form by passing defaults (and optional view mode) from your CMS or backend — PHP, Python, Node.js, or any stack that can print a small config block before the embed script.

In Publish Form, choose Let me set them dynamically under Default variables, then fill in the values from your app:

<script>
window.Calcopolis = window.Calcopolis || {};
window.Calcopolis.config = window.Calcopolis.config || {};
window.Calcopolis.config['YOUR_HASHCODE'] = {
  defaults: { carValue: 50000, interestRate: 0.05 },
  viewMode: 'credit'
};
</script>
<script id="form-YOUR_HASHCODE" async src="https://cdn.calcopolis.com/form/YOUR_COMPANY_ID/YOUR_HASHCODE.js"></script>

Practical examples: prefill product price from a CMS product page, set loan amount from a URL query param, switch lease vs credit view mode per campaign landing page, or inject user-specific defaults after login — without rebuilding the form.

Why it matters: one calculator, many contexts — personalized quotes and clearer journeys without duplicating embeds.

← All updates