Skip to main content

Using Custom Scripts

Adding JavaScript to your checkouts, upsells, confirmation pages, and landing pages in Plug&Pay

Written by Jelle Graafstal

In this guide, you'll learn how to add custom scripts in Plug&Pay. You can use them to load a tracking tool on your checkouts or embed a Calendly widget on your landing pages, for example. Custom scripts can be set globally or per individual page.

ℹ️ This feature is available from Plug&Pay Premium & Ultimate. Using Plug&Pay Lite? Upgrade to Premium or Ultimate to use this feature.

❗️Note: Only add scripts you are familiar with and have properly tested. Incorrect scripts can cause issues. For restoring a backup we charge €120,-. Additionally, we cannot guarantee that every script is compatible with the payment system.


Setting Up Global Custom Scripts

To set up global custom scripts, go to Settings > Custom scripts.

Settings page in Plug&Pay with the 'Custom scripts' tile highlighted under the 'Display & design' section.

Global Custom Scripts: Checkouts, Upsells, and Confirmation Pages

Using the first three tabs, you can add custom scripts for checkouts, upsells, and confirmation pages. Click Save to apply your changes.

Custom scripts page in Plug&Pay with the 'Checkouts' tab active and a script input field.

Global Custom Scripts: Landing Pages

In the Landing pages tab, you can add custom scripts to all your landing pages by clicking Add new script.

Custom scripts page in Plug&Pay with the 'Landing pages' tab active and a button to add a new script.

A pop-up will appear where you can configure your script.

Script name: Give your global custom script a name.

Location: Choose whether to place the script in the <head> or <body> tag of your landing page.

Type: Select the appropriate type for your custom script.

  • Functional: Required for basic functionality; does not collect data.

  • Analytics: Collects anonymous data about user behaviour.

  • Marketing: Stores visitor tracking data, allowing you to show targeted ads.

Optimise for Google PageSpeed: Determine when your custom script is loaded.

  • Enabled: Your script is not loaded immediately, which makes your page load faster.

  • Disabled: Your script loads immediately, which may affect your page load time.

Script field: Paste your custom script here.


Custom Scripts per Page

You can also add custom scripts to individual pages. These only apply to the selected page and are not loaded globally.

Custom Scripts: Checkout

To add a custom script to an individual checkout, open the checkout settings, go to the Advanced tab, and add your script under JavaScript code.

Checkout settings in Plug&amp;Pay with the 'Advanced' tab active and a JavaScript code input field at the bottom.

Custom Scripts: Upsell

To add a custom script to an individual upsell, go to the upsell, click the Advanced tab, and add your script under JavaScript code.

Upsell settings in Plug&amp;Pay with the 'Advanced' tab active and input fields for JavaScript code and a webhook.

Custom Scripts: Confirmation Page

To add a custom script to an individual confirmation page, go to the confirmation page, open the Advanced tab, and add your script under JavaScript code.

Confirmation page settings in Plug&amp;Pay with the 'General' tab active and a JavaScript code input field.

Custom Scripts: Landing Page

To add a custom script to an individual landing page, open the page and go to the Settings tab. Under Custom scripts in the left sidebar, click Add to add your script. The pop-up works the same as for Global Custom Scripts: Landing Pages.

Landing page editor in Plug&amp;Pay with the 'Custom scripts' section highlighted in the left sidebar and a button to add a script.
Did this answer your question?