Embedding the Simple Donation Widget on a Wix site

Follow the steps below to embed the simple widget on your Wix site.

  1. In the Nonprofit Admin Portal, click the "Widget" tab in the menu on the top of the dashboard. 
  2. You'll see a preview of your widget below.
  3. Next, associate your widget with one of your customized fundraising pages. The widget will adopt your campaign’s styling and donation frequency. In addition, donations from the widget will be associated with this fundraising page in data you get from our platform.
  4. Select preset suggested donation amount options for the widget ($25, $50, $100, $250) or set a custom amount.
  5. Click "Get Embed Code" then select and copy the code in its entirety.
  6. Click here and follow the instructions provided by Wix.
  7. When editing your page, click the "Home Page Code" footer, which will bring up an HTML code editor. You should, by default, see the following code (if you have never edited this section before):
    $w.onReady(function () {

       //TODO: write your page related code here...

  8. Delete that code and paste in the following:

const GL_WIDGET_ID = "#html1";

import wixWindow from 'wix-window';

$w.onReady(function () {

   const glWidget = $w(GL_WIDGET_ID);

   glWidget.postMessage("is_wix");

   glWidget.onMessage((event) => {

       if (event.data === "is_wix") {

           glWidget.postMessage("is_wix");

       } else {

           const matches = event.data.match(/^wix:open_modal:(.*)$/);

           if (matches) {

               wixWindow.openModal(`${matches[1]}&show_close_button=false`, {

                   "width": 500,

                   "height": 650

               });

           }

       }

   });

});

9. If you've already embedded one widget on your Wix site, you will need to replace "html1" (highlighted in bold above).

If you have any problems embedding the widget on your site, contact us at support@givelively.org.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.