Embed the widget at organisation level

Joris RenaudJoris Renaud
3 min read
Matching
Installing the Magma widget at organisation level with organizationUuid and integrationUuid code snippets

One integration for all your campuses

By default, a Magma integration is attached to a campaign. If your organisation has several campuses, you can install the integration at organisation level: the widget then displays the campaigns of all your campuses, without declaring each campaign individually.

💡
The difference from a standard integration lies in the declaration script: you use the organizationUuid type and your organisation's identifier, instead of campaignUuid and a campaign identifier.

Prerequisites

✅
To get your UUID and integrationUuid identifiers, please contact the Magma team.

Step 1: Add the Magma script

At the end of the <head> tag (just before </head>), add the initialisation script. It is the same as for a standard integration:

<script src="https://cdn.jsdelivr.net/gh/magma-app/magma-widget@latest/src/widget/initializer.js" async></script>
⚠️
This script should only be added once per page, even if you install several integrations.

Step 2: Declare your organisation

At the beginning or end of your <body> tag, add the following block. Each object in the array corresponds to one integration: here, the widget. Add one entry per integration you want to install.

<script>
  window.magma_app = [
    { // WIDGET
      type: "organizationUuid",
      uuid: "xxxx",
      integrationUuid: "xxxx",
    },
  ];
</script>

Step 3: Replace the identifiers

Replace the "xxxx" placeholders with your actual identifiers. If you add several entries, the organisation UUID stays the same; only the integrationUuid changes:

<script>
  window.magma_app = [
    { // WIDGET
      type: "organizationUuid",
      uuid: "YOUR_ORGANISATION_UUID",
      integrationUuid: "YOUR_WIDGET_INTEGRATION_UUID",
    },
  ];
</script>

Step 4: Place the gallery on your page (optional)

If you are installing the gallery or the profile cards, place the div wherever you want it to appear on your ambassadors page:

<div id="magma-app_gallery"></div>

OR

<div id="magma-app_block"></div>
✅
Done! The integration now displays all your organisation's campaigns.

Configuration options (for the widget)

Disable the automatic popup on arrival

To prevent the widget from automatically opening when visitors land on the page, add the autoPopup: false parameter:

<script>
  window.magma_app = [
    {
      type: "organizationUuid",
      uuid: "YOUR_ORGANISATION_UUID",
      integrationUuid: "YOUR_WIDGET_INTEGRATION_UUID",
      autoPopup: false,
    },
  ];
</script>

Customise the button text and banner colour

You can customise the widget's appearance directly from the code using the customStyles object. Two parameters are available:

<script>
  window.magma_app = [
    {
      type: "organizationUuid",
      uuid: "YOUR_ORGANISATION_UUID",
      integrationUuid: "YOUR_WIDGET_INTEGRATION_UUID",
      customStyles: {
        brandBg: '#E395DC',
        buttonText: 'Chat with a student',
      },
    },
  ];
</script>

Best practices

Related Articles

Installing the Magma widget on a website with campaignUuid and integrationUuid code snippets
Integrations

Embed the widget

Step-by-step tutorial to install the Magma widget on your website and offer matching to your visitors.

Read

Our ambassador strategy experts are ready to assist you

How to engage your ambassadors? How to reward them? How to manage actions over time? Our ambassador strategy consultants are here to turn your ideas into a successful ambassador program.

Joris R.

Joris Renaud

Ambassador strategy expert