Skip to content

Banner Script Installation

Install the GoPayLocal banner script on your site with a single script tag.

The banner script is the simplest way to add PPP discounts to your site. One <script> tag and you’re done.

Add this script tag to your site, just before the closing </body> tag:

<script
src="https://api.gopaylocal.com/v1/banner/script.js?key=YOUR_PUBLIC_KEY"
async
></script>

Replace YOUR_PUBLIC_KEY with your public API key (starts with gpl_pk_). You can find it in the Dashboard.

<!DOCTYPE html>
<html>
<head>
<title>My App</title>
</head>
<body>
<h1>My Pricing Page</h1>
<!-- GoPayLocal Banner Script -->
<script
src="https://api.gopaylocal.com/v1/banner/script.js?key=gpl_pk_live_abc123"
async
></script>
</body>
</html>
  1. The script loads asynchronously — it does not block page rendering
  2. It makes a single API call to fetch PPP config for the visitor’s country
  3. The response is cached in sessionStorage for 5 minutes
  4. A discount banner renders inside a Shadow DOM element
  5. Subsequent page loads within the session use the cache — no additional API calls

The banner is rendered inside a Shadow DOM, which means:

  • Your site’s CSS cannot accidentally break the banner
  • The banner’s CSS cannot leak into your site
  • The banner cannot access your page’s DOM, cookies, or JavaScript scope
  • No layout shifts — the banner uses position: fixed and overlays your content
MetricSize
Uncompressed~5 KB
Gzipped~1.5 KB
Brotli~1.3 KB

This is significantly smaller than most analytics scripts, chat widgets, or A/B testing tools.

If your site uses a Content Security Policy, add these directives:

script-src 'self' https://api.gopaylocal.com;
connect-src 'self' https://api.gopaylocal.com;

The banner script URL includes your API key as a query parameter, which means the script content is dynamically generated per-key. SRI hashes are not applicable for dynamic scripts. The script is served over HTTPS with TLS 1.3.

If you only want the banner on specific pages (e.g., your pricing page), conditionally add the script:

<script>
if (window.location.pathname === '/pricing') {
const s = document.createElement('script');
s.src = 'https://api.gopaylocal.com/v1/banner/script.js?key=gpl_pk_live_abc123';
s.async = true;
document.body.appendChild(s);
}
</script>