> For the complete documentation index, see [llms.txt](https://docs.ecwid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecwid.com/api-reference/rest-api/storefront-widget-details/set-base-url-for-storefront-widgets.md).

# Set base URL for storefront widgets

Ecwid storefront widgets can be added to several of your website pages. For example:

`example.com/store` - Main store page.

`example.com/sale` - Secondary page with one category (products currently on sale).

`example.com/gift-card` - Secondary page with one product widget (gift card).

Such pages won't be "linked" by default. They'll have separate carts and the `/gift-card` page will have a popup checkout. However, there is an easy way of connecting all three pages to one checkout by adding a line of code to all of the secondary pages (`example.com/sale` and `example.com/gift-card`).

The script must be added right after the widget integration code on your website:

```html
// 
// Ecwid integration code
// 
<script>
    Ecwid.setStorefrontBaseUrl('example.com/store');
</script>
```

This way, all 3 pages will work through the checkout on the `/store` page. When customers click on the cart icons/buttons on secondary pages, they'll be redirected to the checkout on the main store page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ecwid.com/api-reference/rest-api/storefront-widget-details/set-base-url-for-storefront-widgets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
