Skip to content

Troubleshooting

Common Booking Widget problems and how to fix them.


Quick diagnosis

Symptom What to check
Page is blank, or the iframe does not load Open the browser console. Verify the publishable key and the agency slug are correct. Confirm your CSP is not blocking frame-src
Widget loads with the wrong branding Update the settings in the HGN dashboard. Settings are pulled live on every request — hard-refresh to clear a cached copy
Clicking Pay shows "refused to connect" Confirm the iframe loads from book.himalayanguardian.com and includes allow="payment; clipboard-write"
Customer pays but never returns to your site Check that return_url is URL-encoded and uses https://. If no return URL is set, landing on the HGN hosted result page is expected behaviour
Console warning about sandbox escape Remove the sandbox attribute from the iframe — it must not be there. Hard-refresh if an older copy is cached

Blank page or the iframe will not load

Work through these in order.

1. Check the browser console

Look for errors prefixed [hgn-sdk]. Capture the full message — HGN support will ask for it.

2. Verify the URL shape

The src must be exactly:

https://book.himalayanguardian.com/<your-slug>?mode=full&pk=<your-pk>

Common mistakes:

  • A typo in the slug, or the wrong slug entirely
  • A missing or truncated publishable key
  • A mode value other than full
  • Extra query parameters beyond pk and return_url
  • The URL wrapped in a redirect or a proxy

3. Confirm the widget is enabled

In the HGN dashboard, Booking Widget › Widget Settings shows a status badge. If it reads Disabled, the widget will not accept bookings — which looks the same as a broken integration from the outside. Turn on Enable booking widget.

4. Check your Content Security Policy

If your site sends a CSP header, it must allow the HGN origin:

Content-Security-Policy: frame-src https://book.himalayanguardian.com;

A CSP block shows in the console as a message about refusing to frame the document. Merge this directive into your existing policy rather than replacing it.


Payment problems

"Refused to connect" when clicking Pay

When the customer pays, the top-level window navigates to the payment gateway — the gateway does not render inside the iframe. Two things make that possible:

  • allow="payment; clipboard-write" must be on the iframe
  • there must be no sandbox attribute on the iframe

Never add a sandbox attribute

A sandbox attribute blocks the top-level navigation the payment step depends on. It also produces console warnings about sandbox escape. Remove it entirely — do not try to fix it by adding permissions to it.

Customer pays but does not come back

If you configured a return_url:

  • It must be URL-encoded in the iframe src
  • It must use https://
&return_url=https%3A%2F%2Fyour-agency.com%2Fbooking-complete

If you did not configure one, the customer lands on the HGN hosted result page. That is expected, not a bug.

Confirmations showing for unpaid bookings

You are trusting the status query parameter. Anyone can type ?status=success in the address bar. Verify server-side — see Payment Verification.


Layout problems

Problem Fix
Widget appears below your site header and above your footer The page is not iframe-only. Remove all page chrome — see Step 2
Widget in a narrow column with white space A wrapper, container, or max-width is constraining it. The iframe must be 100vw × 100vh with no wrapper
Two scrollbars, or the page scrolls behind the widget html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; } is missing or overridden
Broken or cut off on mobile The viewport meta tag is missing. Use width=device-width, initial-scale=1, viewport-fit=cover

On WordPress specifically, see the WordPress problems table.


Testing locally

Serve the page from a local web server and point the iframe at the production widget URL.

python3 -m http.server 8080
npx serve .

Opening the HTML file directly from disk with a file:// URL is not a valid test — serve it over HTTP.

For a sandbox environment, request a sandbox publishable key from your account manager. Sandbox keys are separate from live keys.


Still stuck? Contact support

Send your HGN account manager:

  • The URL of your /insurance page
  • The full [hgn-sdk] console error, if there is one
  • A screenshot or screen recording of the problem
  • Your agency slug

Expected response time: within one business day.

The console error is the most useful thing you can send

Open developer tools, reproduce the problem, and copy the complete [hgn-sdk] message rather than a summary. It usually identifies the cause immediately.