Embed on Website
Embed your DailyPlay games directly on your website for a seamless brand experience.
Embed Methods
Section titled “Embed Methods”iframe Embed
Section titled “iframe Embed”The simplest way to embed your game:
<iframe src="https://dailyplay.app/embed/game/[game-id]" width="400" height="700" frameborder="0" allow="camera; microphone"></iframe>Responsive Embed
Section titled “Responsive Embed”For responsive layouts that adapt to screen size:
<div style="position: relative; width: 100%; max-width: 400px; margin: 0 auto;"> <div style="padding-top: 175%; position: relative;"> <iframe src="https://dailyplay.app/embed/game/[game-id]" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" frameborder="0" allow="camera; microphone" ></iframe> </div></div>Getting the Embed Code
Section titled “Getting the Embed Code”From the Game Page
Section titled “From the Game Page”- Open your published game
- Click Share/Embed
- Select the Embed tab
- Copy the embed code
From Manage Games
Section titled “From Manage Games”- Go to Manage Games
- Find your game
- Click Share/Embed
- Copy the embed code
Embed URL Format
Section titled “Embed URL Format”Standard Embed
Section titled “Standard Embed”https://dailyplay.app/embed/game/[game-id]With Parameters
Section titled “With Parameters”Add query parameters for customization:
https://dailyplay.app/embed/game/[game-id]?hideHeader=true&theme=lightAvailable parameters:
| Parameter | Values | Description |
|---|---|---|
hideHeader | true/false | Hide the game header |
hideFooter | true/false | Hide the footer |
autoplay | true/false | Start game automatically |
Sizing Guidelines
Section titled “Sizing Guidelines”Mobile-First (Recommended)
Section titled “Mobile-First (Recommended)”For mobile-optimized games:
| Dimension | Value |
|---|---|
| Width | 400px |
| Height | 700px |
| Ratio | ~1:1.75 |
Desktop Display
Section titled “Desktop Display”For wider layouts:
| Dimension | Value |
|---|---|
| Width | 500px |
| Height | 800px |
Full-Width Responsive
Section titled “Full-Width Responsive”<div style="max-width: 500px; margin: 0 auto;"> <div style="position: relative; padding-top: 160%;"> <iframe src="https://dailyplay.app/embed/game/[game-id]" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; border-radius: 12px;" allow="camera; microphone" ></iframe> </div></div>Platform-Specific Instructions
Section titled “Platform-Specific Instructions”WordPress
Section titled “WordPress”Using HTML Block:
- Add a new block
- Select Custom HTML
- Paste the embed code
- Preview and publish
Using Shortcode (if available):
Some themes support shortcodes for iframes.
Shopify
Section titled “Shopify”- Go to your page/product in Shopify admin
- Click Show HTML in the editor
- Paste the embed code
- Save
Squarespace
Section titled “Squarespace”- Add a Code Block
- Paste the embed code
- Apply changes
- Add an HTML iframe element
- Paste the iframe code
- Adjust size as needed
Webflow
Section titled “Webflow”- Add an Embed element
- Paste the embed code
- Style the container as needed
Styling the Embed
Section titled “Styling the Embed”Container Styling
Section titled “Container Styling”Wrap the iframe in a styled container:
<div style=" max-width: 400px; margin: 2rem auto; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.1);"> <iframe src="https://dailyplay.app/embed/game/[game-id]" width="100%" height="700" frameborder="0" allow="camera; microphone" ></iframe></div>Centered Layout
Section titled “Centered Layout”<div style="text-align: center; padding: 2rem 0;"> <iframe src="https://dailyplay.app/embed/game/[game-id]" width="400" height="700" frameborder="0" style="border-radius: 12px;" allow="camera; microphone" ></iframe></div>Permissions
Section titled “Permissions”Required Permissions
Section titled “Required Permissions”Include these in the allow attribute for full functionality:
allow="camera; microphone"| Permission | Needed For |
|---|---|
camera | Expression-based games, video recording |
microphone | Voice-controlled games |
If Features Aren’t Used
Section titled “If Features Aren’t Used”If your game doesn’t use camera/mic, you can omit the allow attribute:
<iframe src="https://dailyplay.app/embed/game/[game-id]" width="400" height="700" frameborder="0"></iframe>Security Considerations
Section titled “Security Considerations”HTTPS Requirement
Section titled “HTTPS Requirement”Your website must use HTTPS to embed DailyPlay games. The embed won’t work on HTTP-only sites.
Content Security Policy
Section titled “Content Security Policy”If your site has a CSP, add DailyPlay to your allowed sources:
frame-src https://dailyplay.app;Cross-Origin
Section titled “Cross-Origin”DailyPlay games work within iframes across different origins. No special configuration needed.
Testing Your Embed
Section titled “Testing Your Embed”- Local Testing — Use a local server (http://localhost)
- Check Sizing — Verify the game displays correctly
- Mobile Test — View on mobile devices
- Feature Test — Confirm game plays properly
Troubleshooting
Section titled “Troubleshooting”Game not loading
Section titled “Game not loading”- Verify the game ID is correct
- Check the game is published
- Ensure HTTPS is used
Wrong size
Section titled “Wrong size”- Check width/height attributes
- Use responsive wrapper
- Test on target devices
Camera not working
Section titled “Camera not working”- Add
allow="camera"attribute - Ensure HTTPS (required for camera)
- User must grant permission
Blocked by CSP
Section titled “Blocked by CSP”- Add
frame-src https://dailyplay.appto your CSP - Check browser console for specific errors
Next Steps
Section titled “Next Steps”- Track Analytics for embedded games
- Share via Link for other channels