There are many ways to add Google-rich snippets to a widget.
At the moment, the easiest way is to generate JSON-LD and update the source code of your widget.
We will create an example that takes a review widget and add Google rich snippets to it.
1 - Clone a review widget from Fouita
After adding Fouita to your website, go to the library and clone the "reviews" widget, see Fouita Docs for more details
![Clone Reviews Widget](https://img.fouita.com/0x2729/media/imgs/clone-reviews-w-1665993899106.png?/ext:webp)
2- Get your reviews JSON-LD code
Google offers an extended list of examples that you can copy from and update.
Here is a link to Goole Review Snippet .
You can click on "Try it out in the rich results test" and update your data. Then copy only what is inside the script tag.
3- Edit Reviews Widget Code
Fetch the widget that you cloned earlier and click on the "Edit" icon. Then click on "Edit Code".
![edit reviews widget](https://img.fouita.com/0x2729/media/imgs/reviews-edit-1666002230881.png?/ext:webp)
4- Add the JSON-LD code like the following.
A - Create a new file that will include your JSON-LD data
![new file jld](https://img.fouita.com/0x2729/media/imgs/reviews-add-file-1666002717212.png?/ext:webp)
Don't forget to add export default
before the code you add.
B - Import the file in App.svelte
![import file](https://img.fouita.com/0x2729/media/imgs/import-jld-1666003164645.png?/ext:webp)
C - Add the following code below </script>
tag
<svelte:head>
{@html '<script type="application/ld+json">'+ JSON.stringify(ReviewsJLD) + '</script>'}
</svelte:head>
![add code](https://img.fouita.com/0x2729/media/imgs/add-code-jld-1666003163259.png?/ext:webp)
D - Update the widget
![update widget](https://img.fouita.com/0x2729/media/imgs/force-update-jld-1666003165052.png?/ext:webp)
That's it, now when you add the widget inside your pages, the JSON-LD details will be added to your page.
If you have any issues, please contact support@fouita.com or let us know in the comments.