GM Embed Documentation
Everything you need to add a widget to your site, in plain steps.
1. Choose a widget
Open Explore Widgets. Every listed widget has passed the embed test. Use Preview to try it before you embed.
2. Generate the code
Open the Embed Generator, choose the widget, adjust the look and copy either the iframe or the script code. The preview address shows exactly what visitors will see.
3. Install the iframe (HTML)
Paste this where the widget should appear in your page's HTML:
<iframe src="https://gmtoolshub.com/embed/percentage-calculator/?theme=light" width="100%" height="460" loading="lazy" title="Percentage calculator by GM Tools Hub" style="border:0;max-width:760px;display:block" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-forms allow-downloads" allow="clipboard-write"></iframe>
The sandbox setting limits what the framed page can do on your site. allow-same-origin lets the widget use its own storage and load its own data; it does not give it access to your page.
4. Or use the one-line script
<div data-gm-embed="percentage-calculator" data-theme="dark" data-accent="0e7490" data-radius="18"></div>
<script src="https://gmtoolshub.com/embed/gm-embed.js" async></script>The script creates the same sandboxed iframe and resizes it to fit. It only accepts size messages from https://gmtoolshub.com and only from the frame it created. It never reads what visitors type.
5. Customise with options
| Option | Values | Works on |
|---|---|---|
theme | light or dark | all widgets |
accent | six-digit hex colour for buttons and highlights, no # | calculators |
bg | six-digit hex, or transparent | calculators |
radius | corner radius 0 to 32 (px) | calculators |
font | serif, mono or rounded (system is the default) | calculators |
title | 1 shows a header with the widget name | calculators |
footer | 0 hides the privacy note (the credit link always stays) | calculators |
lang | ur for Urdu | live-rates |
show | gold, silver, usd (comma separated) | live-rates |
For the iframe, add options to the address (?theme=dark&accent=0e7490). For the script, use data-theme, data-accent and so on.
WordPress
- Edit the page or post and add a Custom HTML block.
- Paste the iframe code and update or publish.
- If the preview is blank, your host or a security plugin may strip frames: ask it to allow
gmtoolshub.com.
Not tested on a live WordPress site yet.
Blogger
- In the post editor switch to HTML view.
- Paste the iframe code where you want it, then switch back and publish.
Not tested on a live Blogger site yet.
React
export default function GmWidget() {
return (
<iframe
src="https://gmtoolshub.com/embed/percentage-calculator/?theme=light"
title="Percentage calculator by GM Tools Hub"
width="100%" height={460} loading="lazy"
style={{ border: 0, maxWidth: 760, display: 'block' }}
sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-forms allow-downloads"
/>
);
}Standard iframe in JSX. Not tested in a live React app yet.
Troubleshooting
The widget shows a blank box.
Check that the address starts with https://gmtoolshub.com/embed/ and ends with the widget name, and that your site allows frames from other domains. Some page builders strip iframe tags: use their "custom HTML" or "embed" block.
The widget is cut off or has a scroll bar.
Use the one-line script, which resizes the frame, or increase the height in the iframe code. Widgets with results need more height on narrow screens.
My site blocks the script.
If your Content Security Policy blocks it, allow script-src and frame-src for https://gmtoolshub.com, or use the plain iframe code, which needs only frame-src.
The colours did not change.
Colours must be six-digit hex values without #, for example accent=0e7490. Invalid values are ignored for safety.
Security and privacy
- Widgets are static pages on gmtoolshub.com. Calculations run in the visitor's browser. The widget code does not send what visitors type to GM Tools Hub.
- Widget pages load only their stylesheet and scripts from gmtoolshub.com. They set no cookies and include no analytics or advertising scripts. A Content Security Policy limits what each widget page can load.
- As with any embedded page, the visitor's browser requests the widget from the hosting provider (GitHub Pages), which sees the usual request details such as IP address. Mention this in your own privacy policy if you have one.
- The only cross-window message is the widget height, sent to the host page. The loader accepts it only from https://gmtoolshub.com.
- Limit of the current version: free widgets are public static pages. They cannot be restricted to particular domains and the credit link cannot be enforced by a server. Those features belong to the planned licence server.
Licensing
Free widgets may be embedded on websites with the GM Tools Hub credit link left visible. Do not claim the calculators as your own product and do not remove the credit. Pro and Agency plans (white-label, multiple domains, usage statistics, API access) are planned and require a server that validates licence keys and domains. That server does not exist yet, so no paid licences are sold. See Pricing, Support and the Disclaimer. The calculators give estimates for general information, not professional advice.