Intégrer le calculateur PetYears
Ajoutez nos calculateurs d'âge à votre blog animalier, site de clinique vétérinaire ou toute page. Choisissez iframe pour la configuration la plus simple, ou Web Component pour une intégration plus flexible.
Pourquoi intégrer PetYears ?
- Gratuit pour toujours — sans compte, sans limites
- Entièrement responsive — s'adapte à toute page ou barre latérale
- 7 langues, adaptées automatiquement à votre visiteur
- Basé sur la science et toujours à jour — zéro entretien pour vous
Options
Personnalisez l'apparence via des paramètres d'URL (iframe) ou des attributs (Web Component).
Option 1 : iframe (le plus simple)
Copiez le code ci-dessous et collez-le dans le HTML de votre site. Fonctionne partout.
Fonctionne avec WordPress, Wix, Squarespace, Ghost ou tout site acceptant un bloc HTML.
<iframe src="https://petyears.app/en/e/dog/"
width="100%" height="820" frameborder="0"
title="PetYears calculator" loading="lazy"
allow="clipboard-write"></iframe> Option 2 : Web Component
Incluez notre script une fois, puis utilisez la balise comme tout élément HTML. Responsive automatique.
<script src="https://petyears.app/embed.js" defer></script> <petyears-calculator animal="dog" lang="en"></petyears-calculator>
Aperçu
Reference
- iframe:
- path segment
- Web Comp:
- animal
- Values:
- dog, cat, rabbit, hamster, guinea-pig, horse, ferret
- iframe:
- path segment
- Web Comp:
- lang
- Values:
- en, de, fr, it, es, pt, pl
- iframe:
- ?primary=2b2d5b
- Web Comp:
- primary
- Values:
- hex without #
- iframe:
- ?bg=e8f5ee
- Web Comp:
- bg
- Values:
- hex without #
- iframe:
- ?accent=a0d4bc
- Web Comp:
- accent
- Values:
- hex without #
- iframe:
- ?text=1f1d4a
- Web Comp:
- text
- Values:
- hex without #
- iframe:
- ?hideShare=1
- Web Comp:
- hide-share
- Values:
- boolean flag
- iframe:
- ?host=https://yoursite.com/page
- Web Comp:
- auto (top window URL)
- Values:
- http(s) URL — falls back to referrer, then petyears.app
- iframe:
- ?ref=yoursite
- Web Comp:
- ref
- Values:
- up to 64 chars, [a-zA-Z0-9._-] — shows up in analytics
- iframe:
- iframe height="820"
- Web Comp:
- height
- Values:
- pixels (default 820)
| Option | iframe (URL param) | Web Component (attr) | Values |
|---|---|---|---|
| Animal | path segment | animal | dog, cat, rabbit, hamster, guinea-pig, horse, ferret |
| Language | path segment | lang | en, de, fr, it, es, pt, pl |
| Primary color | ?primary=2b2d5b | primary | hex without # |
| Background color | ?bg=e8f5ee | bg | hex without # |
| Accent color | ?accent=a0d4bc | accent | hex without # |
| Text color | ?text=1f1d4a | text | hex without # |
| Hide share | ?hideShare=1 | hide-share | boolean flag |
| Host URL (share target) | ?host=https://yoursite.com/page | auto (top window URL) | http(s) URL — falls back to referrer, then petyears.app |
| Ref (analytics label) | ?ref=yoursite | ref | up to 64 chars, [a-zA-Z0-9._-] — shows up in analytics |
| Height (WC only) | iframe height="820" | height | pixels (default 820) |