Embed guide

Add CauseMissions to your website

Add one script, then add a placement. Clicking the placement opens CauseMissions in a popup, so visitors can start missions without leaving your page. Every code box below is editable, and the preview next to it updates as you type.

On WordPress, Squarespace, Wix or another site builder? See the steps for your platform ↓

Every snippet below uses this EIN. Change it to preview the widgets for your own nonprofit. You can also edit a single snippet by hand; each preview runs the code in its own box.

1. Add the script (once)

Add this to your page once. Every placement below needs it.

<script src="https://causemissions.com/embed/v1.js" async></script>

2. Add a placement

Each placement is a single <div>. Point it at your cause to show all of its missions, or at one specific mission to show only that one.

A Promote your cause

Set your EIN and leave out data-mission. The popup lists every mission for your cause, and the banner headline reads “Support {your cause}”.

Live preview

Live preview

Live preview

B Feature a specific mission

Add data-mission and the widget loads that mission's details from CauseMissions. A banner shows its image, name and donation amount; a card shows the donation amount. There's no text for you to keep up to date.

Live preview

Live preview

Live preview

Nothing renders here because this mission isn't available.

Unavailable missions hide themselves. If the mission has ended, is paused, or isn't offered in your visitor's region, the placement doesn't render at all. Visitors never see a dead button or a broken link.

+ Phone & tablet missions

Some missions run on a phone or tablet (Android, iPhone, iPad). By default, such a mission only renders for visitors on a matching device, and desktop visitors see nothing. That means you can place one embed per device and only the right one appears. Add data-desktop-devices="iphone,android" (any combination, or "all") to show it to desktop visitors too. After they click, the mission provider shows a QR code they scan to do the mission on their phone or tablet. This only changes what desktop visitors see. Visitors already on a phone or tablet aren't affected.

<div data-causemissions data-cause="131788491"
     data-type="card"
     data-mission="123456"
     data-desktop-devices="all"></div>

3. Customize the text and color

Add data-label to set your own text: the label on a button, or the line under a cause banner's headline. Try editing it:

Live preview

On a mission banner, your label only shows while the mission loads. After that, the mission's name and donation amount replace it.

Use data-color to match your brand. Pass any hex color and the widget uses it, with a readable text color picked for you. It applies to content placements (cards and mission banners). Placements that show the CauseMissions mark (buttons and the cause banner) stay in our brand green.

Live preview

The full set of optional attributes:

Attribute Values What it does
data-type card · button · banner · missions How the placement looks on your page. Defaults to button.
data-size lightbox · takeover How the popup opens: a centered lightbox or a full-screen takeover. Omit it and missions opens full-screen while everything else opens as a lightbox. On mobile every popup is full-screen.
data-color any hex, e.g. #7c3aed Retints content placements (cards, mission banners) with your brand color. Ignored on placements that show the CauseMissions mark.
data-desktop-devices android · iphone · ipad (comma list) · all Desktop-only override: also offer this phone/tablet mission to desktop visitors, who continue via a QR-code handoff. Never affects visitors already on a mobile device. On a missions placement it pre-selects the device filter.

data-cause is the only required attribute. data-mission turns any placement into a single-mission embed that fills in its own details and hides itself when the mission is unavailable.

4. Add it on WordPress, Squarespace, Wix and more

Most site builders have a block for pasting code. Copy this snippet (the script and a button together) and paste it there. Pasting it in more than one spot is fine.

Want a banner or a mission card instead? Copy any placement from step 2 and paste it under the script.

WordPress Plugin with a block, a widget and a shortcode

The CauseMissions plugin adds a CauseMissions block with a live preview, a widget for sidebars and footers, and a [causemissions] shortcode for page builders like Elementor and Divi. It only loads our script on pages that show a placement.

Download the WordPress plugin (.zip)
  1. In WordPress, go to Plugins → Add New Plugin → Upload Plugin, choose the zip file, click Install Now, then Activate.
  2. Go to Settings → CauseMissions and enter your EIN (131788491).
  3. Add the CauseMissions block to any page or post, and pick a button, banner or mission card in its settings. For a sidebar or footer, add it in Appearance → Widgets.
  4. In a page builder or the classic editor, use the shortcode: [causemissions] or [causemissions type="banner" label="Each mission unlocks a donation"].

No plugin? Add a Custom HTML block and paste the snippet. Only administrators can add scripts. On WordPress.com, scripts need a plan that allows plugins; on other plans, use the plain link below.

Squarespace Code block
  1. Edit the page, click Add Block (or the +) and choose Code.
  2. Replace the sample code with the snippet, keep the type set to HTML and leave Display Source off.
  3. Click outside the block, then Save. The button shows on the live page.

Squarespace only runs scripts in code blocks on some plans. If the button doesn't show, use the plain link below.

Wix Embed HTML
  1. In the Editor, click Add Elements (+) → Embed Code → Embed HTML.
  2. Click Enter Code, choose Code, paste the snippet and click Update.
  3. Drag the box's edges to fit the button, then Publish.

Wix runs pasted code in a small box of its own, so clicking the button opens CauseMissions in a new tab instead of a popup.

Webflow Code Embed
  1. Open the Add panel and drag a Code Embed element onto the page.
  2. Paste the snippet and click Save & Close.
  3. Publish the site. The button shows on the published site.

Code Embed needs a paid Webflow site or workspace plan.

Google Sites Embed code
  1. Click Insert → Embed and open the Embed code tab.
  2. Paste the snippet, click Next, then Insert, and resize the box to fit.
  3. Publish the site.

Like Wix, Google Sites runs pasted code in a box of its own, so the button opens CauseMissions in a new tab.

Wild Apricot Custom HTML gadget
  1. Edit the page, open the Gadgets tab and drag a Custom HTML gadget onto the page.
  2. Click the gadget, click Edit code, paste the snippet and save.
  3. Save the page. The button shows on the live site.

If the button doesn't show, use the plain link below.

GoDaddy Website Builder HTML section
  1. Edit the page, click Add Section (the +) and search for HTML.
  2. Paste the snippet into the code box and click Done.
  3. Publish. The button only shows on the published site, not in the editor.

GoDaddy may run pasted code in a box of its own. If so, the button opens CauseMissions in a new tab. Some GoDaddy plans don't run scripts at all; if the button doesn't show, use the plain link below.

Square Online and Weebly Embed code

Square Online

  1. In your Square Dashboard, go to Square Online → Website → Edit site and open the page.
  2. Click Add → Section, choose Embed code and paste the snippet.
  3. Publish. The Embed code section needs a paid Square Online plan.

Weebly

  1. Drag an Embed Code element onto the page.
  2. Click it, choose Edit Custom HTML and paste the snippet.
  3. Publish the site.
Drupal, Joomla and other site builders HTML or code block

Look for a block or element called Embed code, Custom HTML, HTML or Code, and paste the snippet. In Drupal, switch the text format to Full HTML first. In Joomla, use a Custom module with an editor that keeps scripts.

If the editor removes the script when you save, it doesn't allow code. Use the plain link below instead.

Stuck, or your platform isn't listed? and we'll help you add it.

Can't add code? Use a plain link

Some plans and newsletter tools strip scripts. This button is plain HTML, so it works anywhere you can paste HTML, including emails. It opens your CauseMissions page instead of a popup.

This is the way to go on Substack, Notion pages and newsletters like Mailchimp and Constant Contact. On Linktree and other link-in-bio pages, add your CauseMissions page link (the address in the code below) as a link.

Live preview

Shareable links. While the popup is open, your page's URL carries a #causemissions=… fragment that records where the visitor is in the popup. Back and forward work as expected, and a copied URL reopens the popup at the same spot. You can use this to link to one mission from a newsletter, for example. Closing the popup restores your page's own URL.