</> Developers Guide to Funraisin

Building with Generative AI on Funraisin

AI tools are great at writing HTML, CSS, JavaScript, and PHP, but they don't know how Funraisin processes custom code or which platform features shouldn't be bypassed. This page covers the rules AI-generated code needs to follow on Funraisin.

The easiest way to apply these rules is with our developer prompt. It's a set of instructions you give your AI tool at the start of a conversation, or save as custom instructions, before you ask it for any code.

The prompt tells the AI how Funraisin works: what's already loaded on the page, which characters Code Blocks remove, how to query data safely, and what it must never build, such as payment forms. The code you get back is more likely to work first time, is safer to publish, and is easier to review, test, and maintain.

Funraisin AI Developer Prompt

Works with ChatGPT, Claude, Gemini, Copilot, Cursor, and most other AI tools.

Ground Rules

  • Native first. Build with Visual Builder blocks and native forms, and use custom code to extend a page rather than replace it.
  • Keep it small. One snippet, one job, self-contained so it can't affect the rest of the site.
  • Display and enhance only. Custom code can change how pages look and behave in the browser, but it must not save or change platform data, handle payments, or override core platform features.
  • You own it. Understand every line before you publish it, whoever (or whatever) wrote it.

Where Code Can Go

Always add code in the most specific place that does the job. If it only matters on one page, don't add it site-wide.

LocationAcceptsApplies to
Code Block (Visual Builder)HTML, CSS, JS, PHPOne spot on one page
Row / block custom CSS and JSCSS, JSOne row or block
Page custom CSSCSSOne page
Event custom CSS and JSCSS, JSOne event
Registration form / Webform CSS and JSCSS, JSOne form
Platform Setup custom CSS, JS and footer codeCSS, JS, HTMLThe whole site
Platform Setup tracking fieldsTracking tagsThe whole site, with cookie consent

How Code Blocks Handle Your Code

The important thing to know is that Code Block content isn't output exactly as you typed it. Before the page renders, Funraisin removes backslashes, decodes HTML entities, strips some restricted function names, runs any PHP, and treats anything like [[lb]]first_name[[rb]] as a personalization tag.

Most fields that accept custom code also strip backslashes. AI-written code regularly trips over this, so here's what to watch for:

Breaks on Funraisin

  • /[[bs]]d+/
  • 'It[[bs]]'s here'
  • `Hi $[[lb]]name[[rb]]`
  • if(x)[[lb]]return[[rb]]

Works on Funraisin

  • /[0-9]+/
  • "It's here"
  • 'Hi ' + name
  • if (x) [[lb]] return; [[rb]]

Front End

  • jQuery, Bootstrap 5, and Font Awesome are already loaded, so use those rather than adding new libraries.
  • Wrap JavaScript in $(function () [[lb]] ... [[rb]]), as some platforms load scripts at the bottom of the page.
  • Prefix every CSS selector with a unique wrapper class, and never restyle global elements like body, headings, or .btn.
  • Don't hide or override native forms, navigation, cookie consent, or tracking.

Below is an example of a self-contained Code Block section:

[[lt]]div class="my-appeal-hero">
      [[lt]]h2>Help us reach our goal[[lt]]/h2>
    [[lt]]/div>
    
    [[lt]]style>
      .my-appeal-hero [[lb]] padding: 48px 16px; text-align: center; [[rb]]
    [[lt]]/style>
    
    [[lt]]script>
      $(function () [[lb]]
        var $hero = $('.my-appeal-hero');
        if (!$hero.length) [[lb]] return; [[rb]]
      [[rb]]);
    [[lt]]/script>

PHP

PHP in a Code Block runs on the server every time the page loads. An error can stop the whole page rendering, and slow code affects every visitor, so keep it simple:

  • Read-only. No inserts, updates, or deletes.
  • Cached. Use the cached database helpers with a LIMIT, or better still, an existing helper like GetDonations(). See Helpers and Caching.
  • Safe. Cast IDs with (int), escape output with htmlspecialchars(), and never trust $_GET or $_POST.
  • Private. Never output supporters' emails, phone numbers, addresses, or payment details.
  • Self-contained. No external HTTP calls, file access, shell functions, secrets, or session changes.

Page variables like $SetupDetails aren't available inside a Code Block, so call PlatformSetup() instead. Below is an example of a cached, read-only query:

[[lt]]?php
    $SetupDetails = PlatformSetup();
    $event_id = 123;
    
    $sql = "SELECT ... WHERE event_id = " . (int) $event_id . " LIMIT 5";
    $rows = MySQLRowsCache($sql, 5, 0, array('SetupDetails' => $SetupDetails), 'my_top5_' . (int) $event_id, 600, true);
    
    if (!empty($rows)) [[lb]]
        foreach ($rows as $row) [[lb]]
            echo '[[lt]]p>' . htmlspecialchars($row['name'], ENT_QUOTES, 'UTF-8') . '[[lt]]/p>';
        [[rb]]
    [[rb]]
    ?>

Forms, Libraries and the API

Forms. All donations, registrations, and payments must use native Funraisin forms. To show a donation form in a custom layout or popup, use the embed code from the Embed tab on the donation page. Don't rebuild or modify the form.

Third-party libraries. We don't allow unapproved third-party libraries, plugins, or externally hosted scripts. To request approval, reach out to the Funraisin team by submitting a support ticket via your platform. If one is added without approval, any issues it causes are your organization's responsibility. Tracking tags belong in the Platform Setup tracking fields.

The API. If you're showing Funraisin data on another website, follow the Funraisin API guide. Keep API credentials server-side and never put them in a Code Block or browser JavaScript.

Testing

  • Preview on desktop and mobile, and check the browser console for errors.
  • Make a test donation or registration on any page with a native form.
  • Check that personalization and tracking still work.
  • Keep a dated copy of the code and the prompt you used.

Support

The Funraisin Support team can provide best-practice advice and general guidance on using AI-generated code. Standard support does not include debugging or fixing AI-generated code that is not native to the Funraisin platform.

If AI-generated code is incompatible with the platform, the Funraisin Support team may recommend removing it and can provide guidance on using existing Funraisin features to achieve a similar outcome. Funraisin also reserves the right to deactivate or remove custom code that introduces security risks or affects platform stability.

Your organization is responsible for any custom code published on its platform. Funraisin recommends testing AI-generated code on a draft or test page before publishing it to your live website.

Funraisin's Professional Services team can help bring ideas to life, whether it's a full project build, a small customization, or reviewing AI-generated code and designs to ensure they're implemented correctly within the platform.

For additional assistance, reach out to the Funraisin team by submitting a support ticket via your platform, including a brief overview of what you'd like to achieve. The team can discuss your requirements and provide a proposed Scope of Work and timeline to help turn your ideas into reality.

Not a developer? Our Platform Setup: Using Generative AI with Funraisin support article covers the basics without the technical detail, and includes a simpler starter prompt.