You can add an Alia Embedded Form to any website, not just Shopify. This article explains the two pieces of code your site needs, where each one goes, and how to preview your form before it goes live.
If you haven't created your Embedded Form campaign yet, start with What is an Embedded Form campaign type?
š” Note: On Magento, Alia's module adds the base script for you, so you can skip step 1. Only headless Magento stores add it by hand. See Connecting your Magento store to Alia.
The base script and the embed snippet
Your site needs both of these for an Embedded Form to show:
The base script loads Alia on your site. It's one line of code that goes on every page, and you only add it once. It's the same script that shows your overlay popups.
The embed snippet marks where a specific form should appear. Each Embedded Form campaign has its own snippet, and it goes only where you want that form.
The embed snippet does nothing on its own. If the base script isn't on the page, the form won't load.
Step 1: Add the Alia base script to your site
1. In Alia, go to Settings > General > Embed Alia. You'll also find it as Embed Alia in your site in the setup guide.
2. When asked how you want to embed Alia, choose Headless or non-Shopify.
3. Copy the script.
4. Add it to every page of your site. The easiest way is usually your site's shared header or footer template, or a site-wide custom code setting.
5. Back in Alia, select Continue.
6. Open your site in a new tab. Alia confirms with "Alia embed script detected. You're all set!"
š” Tip: If shoppers move between domains, such as a main site and a separate shop, add each one under Settings > General > Domains so a visitor is recognized as the same person. The base script needs to be on each domain.
Step 2: Copy your form's embed snippet
Open your Embedded Form popup in the popup editor.
Open the Embed tab in the right panel.
Copy the snippet. It looks similar to this, with your own campaign ID:
<div id="__alia_mount_campaign_12345"></div>
Step 3: Place the snippet where the form should appear
Paste the snippet into your page's HTML at the spot where you want the form. Most website builders have a custom HTML or code block you can add to a page for this.
To show the form on every page, such as in your footer, add the snippet to your shared footer template.
To show it on one page, add the snippet to that page only.
The snippet has to be part of the page when it first loads. If it's added later, for example inside a section that loads after the rest of the page, the form won't appear until the next full page load.
Using a custom selector instead
If your page already has an element where you want the form, you don't need to paste the snippet. On the Embed tab, check Use a custom selector and enter a CSS selector for that element, such as #newsletter-signup or .footer-form.
Alia adds the form inside the first element that matches, after anything already in it. If nothing matches, Alia looks for the standard snippet instead.
š” Note: This option is best suited for users who are comfortable working with HTML and CSS selectors.
Step 4: Preview the form on your site
Make sure the base script and the snippet are on the page.
In the popup editor, click Preview.
In the tab that opens, copy the preview parameter from the end of the URL. It looks similar to this:
?alia_preview=XXXXXXXX
4. Open your page and paste the parameter at the end of its URL. If the URL already contains a ?, replace the ? at the start of the parameter with &.
5. Load the page. Your form appears where you placed the snippet.
Visitors won't see the form until you publish your campaign.
š” Note: The Preview tab itself shows your form as a popup on a blank page. It only takes its embedded look on your own site.
Platform limits
A few things work differently outside Shopify:
Pages that change without a full reload. Alia places the form once, when a page first loads. On sites that switch pages without reloading, such as many headless or single-page storefronts, a form on a page the visitor moves to later won't appear until that page is fully reloaded.
Shopify-only setup steps. Custom Liquid sections and the Shopify theme editor steps in other articles don't apply. Use your site's HTML or custom code blocks instead.
Consent. The Shopify's cookie banner option for marketing consent only works on Shopify. Use Custom code instead.
Frequently asked questions
I added the snippet, but the form isn't showing. What should I check?
First make sure the base script is on the page. The status at the top of Alia shows Not embedded if Alia can't see itself on your site. Then check your targeting in a private or incognito window. For the full checklist, see Embedded Form best practices and troubleshooting.
Do I need to add the base script again for each form?
No. The base script goes on your site once. Each new Embedded Form campaign only needs its own snippet.
Can I put the same form in two places on one page?
No. Each campaign shows its form once per page. To show forms in two places, create a separate Embedded Form campaign for each and use each campaign's snippet.
My site uses more than one domain. Will the form work on all of them?
Yes, if the base script is on each domain. Add every domain under Settings > General > Domains. If Only run on these domains is turned on, Alia won't run on a domain that isn't listed.
Still have questions?
Start a chat from inside the Alia app, or use the chat in our Help Center.
