Website builders
The embed code is plain HTML, so it works anywhere you can add your own code. Pick your platform for the steps. In each case, first copy the code from the game's Embed dialog in Studio.
- Open the post or page in the block editor.
- Where the game should go, add a Custom HTML block.
- Paste the code and update the post.
In the classic editor, switch to the Text tab and paste the code there.
Some hosted WordPress plans remove scripts from posts. If the space stays empty, check with your host, or link to the game's share link instead.
- In the Designer, drag a Code Embed element to where the game should go.
- Paste the code and save.
- Publish the site. Code doesn't run in the Designer's canvas, so check the game on the published site.
Custom code needs a paid site plan in Webflow.
- Go to Online Store › Themes and press Customize.
- Open the page or template where the game should go.
- Add a Custom Liquid section, paste the code into it and save.
The code has no Liquid in it, so it works as it is.
- Edit the page and add a Code block where the game should go.
- Set it to HTML, paste the code and save.
Code blocks that run scripts need a plan that allows them in Squarespace.
- In the editor, choose Add › Embed Code › Embed HTML.
- Choose Code, paste the code and press Update.
- Make the box tall enough for the game, about 700 px.
Wix runs your code inside a frame of its own, on a Wix address. If you have limited Your sites, the game sees that address rather than your domain and may say This game isn’t available on this site. Leave the list empty for Wix pages, or link to the game's share link.
- In the post editor, add an HTML card where the game should go.
- Paste the code and publish.
Render an empty div for the game and load the script once. The script finds games added later on its own, so client-side navigation works.
import { useEffect } from 'react'
const SCRIPT = 'https://play.playgent.com/embed/v1.js'
export function PlaygentGame({ id }: { id: string }) {
useEffect(() => {
if (document.querySelector(`script[src="${SCRIPT}"]`)) return
const script = document.createElement('script')
script.src = SCRIPT
script.async = true
document.body.appendChild(script)
}, [])
return <div className="playgent" data-id={id} style={{ minHeight: 640 }} />
}Don't render anything inside the div: the script puts the game there.
next/script loads the script once, however many games are on the page.
import Script from 'next/script'
export function PlaygentGame({ id }: { id: string }) {
return (
<>
<div className="playgent" data-id={id} style={{ minHeight: 640 }} />
<Script src="https://play.playgent.com/embed/v1.js" strategy="afterInteractive" />
</>
)
}Use it in any page or layout: <PlaygentGame id="pg_7hk2qp0azx" />.
Anywhere else
If your platform lets you add HTML with a script, paste the code as it is. A few things help:
- Inline styles removed? Some editors strip the
styleattribute. Keep the space in your own CSS, for example.playgent { min-height: 640px }. - Strict security headers? If your site sends a Content-Security-Policy, allow Playgent as shown in the Embed reference.
- Code shown inside a frame? Some builders put custom code inside a frame on their own address. Then Your sites sees that address, not yours.
- No code allowed at all? Link to the game's share link. It works on its own page, no website needed.