Skip to main content

Embedding a Campaign on Your Store

Add a referral campaign to your store with the Mage Referral Campaign theme block and the campaign's Display code.

Written by Kris James

The Mage Loyalty app embed must be enabled on your live Shopify theme before referral campaigns can track referral links or show the site-wide popup on your storefront. If you have not done this yet, see: How to Enable the Mage Loyalty App Embed.

Once your referral campaign is set up, add it to a page on your store with the Mage Referral Campaign theme block. Every campaign has its own 6-digit Display code, which tells the block which campaign to show.

Referral Campaigns require the Growth plan or above.


Get the Display Code

  1. Open Mage Loyalty and click Referrals in the left menu, then Referral Campaigns.

  2. Click Manage next to your campaign and choose Copy Display Code.

You can also find the code in the campaign editor, on the General tab under Embed Code.


Add the Campaign Block to Your Theme

  1. From your Shopify admin, go to Online Store > Themes and click Customize on your live theme.

  2. Open the page where you want the campaign to appear. This is usually the page set as your Referrals Landing URL Path.

  3. Click Add section, open the Apps tab and choose Mage Referral Campaign.

  4. Paste the code into the Campaign Display Code field.

  5. Click Save.

You can add the block to more than one page, and use a different Display code on each page to show different campaigns.


Switch On the Campaign

  1. Return to the campaign editor in Mage Loyalty.

  2. On the General tab, switch Campaign Status on.

  3. Click Save.


The Block and the Site-wide Popup

The campaign block is where customers join your referral program and get their link. Friends who click a referral link see the claim form on the block.

With Enable site-wide popup switched on in the campaign's General tab, friends also see the claim form as a popup on whichever page the link opens, even if that page has no block. The popup is on by default for new campaigns.


Common Mistakes to Avoid

Entering the wrong code. The Campaign Display Code must match the campaign you want to show. Copy it again with Copy Display Code to be sure.

Putting the block on a page that referral links do not open. Make sure the page with the block matches the Referrals Landing URL Path in Referrals > Settings, or keep the site-wide popup on.

Adding the block but leaving the campaign switched off. Switch Campaign Status on and save.


Troubleshooting

The campaign is not showing on my store

  • Check that the Mage Referral Campaign block is on the right page and the theme is saved.

  • Check that the Campaign Display Code matches your campaign.

  • Check that Campaign Status is on in the campaign editor.

  • Check that the Mage Loyalty app embed is enabled on your live theme.

  • Test in a private browser window.

Friends are not seeing the claim form when they click a referral link

  • Check that Enable site-wide popup is on in the campaign's General tab.

  • Check that the Mage Loyalty app embed is enabled. The popup needs it.

  • Check that the Referrals Landing URL in Referrals > Settings points to a published page on your store.

Did this answer your question?