--- title: Add structured data (JSON-LD) to HTML items from index fields slug: m52a0468 canonical_url: https://docs.coveo.com/en/m52a0468/ collection: leverage-machine-learning source_format: adoc --- # Add structured data (JSON-LD) to HTML items from index fields When using a [Coveo Machine Learning (Coveo ML)](https://docs.coveo.com/en/188/) [Smart Snippet](https://docs.coveo.com/en/laea5490/) [model](https://docs.coveo.com/en/1012/) to extract questions and answers from a web page, we recommend that you use [Google structured data](https://developers.google.com/search/docs/data-types/faqpage) in JSON-LD format within the `
` of the web page HTML for optimal results. In addition to, or in the absence of JSON-LD, the model searches headers (`Additional information can be found on our support website.
``` To always provide relevant snippets, you modify the [above IPE](#basic-recipe) to include custom code that will only scope elements appearing within the `Procedure` section of the item's HTML, and use this information as the `answer` section of the JSON-LD generated by the IPE. ## Usage This section provides instructions on how to create the post-conversion IPE script and assign it to the desired sources. ## Step 1: Create the indexing pipeline extension (IPE) script  . On the [**Extensions**](https://platform.cloud.coveo.com/admin/#/orgid/content/extensions/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/extensions/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/extensions/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/extensions/)) page of the Coveo Administration Console, click **Add extension**. . On the **Add an Extension** page, in the **Extension name** input, enter a meaningful name for your extension. . In the **Extension** input, you can optionally add a description for your extension. . In the **Select additional item data that the extension needs to access** section, select the **Body HTML** option. . In the **Select restricted parameters that the extension needs to access** section, make sure the **Vault parameters** option is cleared. . In the **Extension script** section, paste the [IPE script](#basic-recipe) and update the code to your needs. . [Assign the IPE script to your source](#step-2-assign-the-indexing-pipeline-extension-ipe-script-to-a-source). ## Step 2: Assign the indexing pipeline extension (IPE) script to a source  . On the [**Sources**](https://platform.cloud.coveo.com/admin/#/orgid/content/sources/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/sources/)) page of the Coveo Administration Console, click the source to which you want to apply the IPE, and then click **More** > **Add extensions** in the Action bar. . On the page that opens, click **Add**, and then select **Extension**. . On the page that opens, in the **Extensions** section, select the [IPE you created](#step-1-create-the-indexing-pipeline-extension-ipe-script). . In the **Stage** section, select **Post-Conversion**. . In the **Action on Error** section, select **Skip Extension**. . In the **Apply to** section, depending on whether your Coveo ML Smart Snippet model applies to specific [item types](https://docs.coveo.com/en/l6he0424#document-type): ** If your Coveo ML Smart Snippet model doesn't scope specific item types, select **All items (common)**. ** If your Coveo ML Smart Snippet model scopes specific item types, select **Specific item types**, and then specify the item types to which the IPE should apply. . (Optional) In the **Condition(s) to apply** section, you can add a condition to the extension to scope the items on which the extension should apply (for example, `%[documenttype] == "Solution"`). . Click **Apply extension**. . Click **Save and rebuild source** to apply the IPE to your source. > **Important** > > To see the impact of the IPE in snippets extracted by a Coveo ML Smart Snippet model, update the model after the targeted sources have been rebuilt with the IPE. :leveloffset!: