# Site actions: add to cart from chat and navigate to page

> How the chat assistant adds products to the cart and takes visitors to the right page: defining site actions, confirmation rules and security, step by step.

Source page: https://dblinx.net/en/smartoperator/blog/sohbetten-sepete-ekleme-ve-yonlendirme

---

Site actions

# Site actions: adding to cart from chat and redirecting to pages

The difference between an assistant answering queries and an assistant working with users lies in site actions: adding to cart from chat, navigating to pages, and booking appointments.

SmartOperator team4 min readPublished: 17.10.2026

- [Site actions](/en/smartoperator/blog/#etiket-site-eylemleri)

- [E-commerce](/en/smartoperator/blog/#etiket-e-ticaret)

- [Developer](/en/smartoperator/blog/#etiket-gelistirici)

A classic chat tool answers questions but does not take the visitor to the product page, cart or appointment form; after receiving the answer, the visitor has to find the way themselves. Site actions fill this gap: the assistant performs tasks defined by your site within the conversation.

## How does the chat assistant add a product to the cart?

Adding to the cart is your site's own action: it is defined on your page with its name, description, parameters and confirmation rule. The assistant only runs defined actions; parameters are validated according to definition. On important steps like placing an order, a Confirm button appears in the chat and the action does not run without visitor confirmation. The action runs in the visitor's browser, with their own session.

## Are site actions secure?

Actions run in the visitor's browser and with the visitor's own session; your site's admin password or server access is not provided. If an action not in the list is suggested, it is discarded. Redirection is only done within the same site and after asking the visitor. The payment page is the agent's final stop: the page is not read and no actions run there.

## Three actions ready on every site

Go to page, show section and search on page actions come ready on every site; you do not need to define them.

- **Go to page:** Takes the visitor to the relevant page on the same site. Before redirecting, the assistant must ask "Shall I direct you to the relevant page?"; redirection to another domain is not performed.

- **Show section:** Scrolls the page to the relevant section and highlights the section with a frame for a few seconds.

- **Search on page:** Finds and marks the searched term on the current page.

## Your site's own actions

Tasks such as adding to cart, selecting size, applying coupon or booking an appointment are specific to the site. These are defined on your page with their name, description, parameters and confirmation rule. The assistant can only run defined actions; if it suggests an action not in the list, the suggestion is discarded.

```
<script>
  SmartOperator.eylemTanimla("sepeteEkle", {
    aciklama: "Ürünü sepete ekler",
    parametreler: {
      urunId: { tur: "metin" },
      adet: { tur: "sayi", en_az: 1 }
    },
    onayGerekir: false
  }, async function ({ urunId, adet }) {
    await sepet.ekle(urunId, Number(adet) || 1);
    return { tamam: true, sepetAdedi: sepet.adet() };
  });
</script>
```

## Step-by-step: add to cart action

The add-to-cart action is selected, defined in your site's common template, and a confirmation rule is added for important tasks.

- **Select the action:** Specify the task you want the assistant to perform; in e-commerce, adding to cart and navigating to the page are most common.

- **Define:** Define the action in your site's common template, after the tag, as shown above. Parameters are validated according to definition.

- **Add a confirmation rule:** For important tasks like placing an order or submitting a form, write onayGerekir: true; a Confirm button appears in the chat and the action does not run without visitor confirmation.

- **Try it:** Test your live site in incognito mode without customers seeing.

Actions defined for the site and their parameters are visible on the dashboard.

## Security: who has permission to execute actions?

Site actions run in the visitor’s browser using their own session. Your admin password or server access is not granted to SmartOperator. The payment page is the representative’s final stop: the assistant prepares the cart and redirects the visitor to the payment page; the page content is not read and no actions run there.

## Your representatives also use the same actions

A representative taking over a conversation can trigger the same actions from the action panel on the right side of the dashboard on the visitor’s page: adding a product to the cart or navigating the visitor to a specific page. This way, AI and the team work with the same tools.

- List which tasks will become actions (add to cart, appointment form, coupon).

- Set confirmation rules for important tasks.

- Add your payment page URLs to settings or mark the page with code.

- Test actions in incognito mode.

## How SmartOperator solves this

SmartOperator comes with three actions ready for every site; tasks like adding to the cart are defined on your page and require visitor confirmation at key steps.

- **Ready actions:** Go to page, show section and search on page appear on every site.

- **Site actions:** Tasks such as add to basket and appointment form are defined on your page; only defined ones work.

- **Confirmation rule:** Actions do not execute without visitor confirmation at important steps.

- **Payment page:** The representative does not read or execute actions on the payment page.

[Site actions](/en/smartoperator/site-eylemleri.html)[Define site action](/en/smartoperator/belgeler/gelistirici/site-eylemi-tanimlamak.html)[Marking the payment page](/en/smartoperator/belgeler/gelistirici/odeme-sayfasini-isaretlemek.html)

## Frequently asked questions

Can the assistant place an order on behalf of the visitor?

Important actions like orders are defined to require confirmation; a Confirm button appears in the chat and does not execute without visitor confirmation. No actions execute on the payment page.

Can the assistant take the visitor to another site?

No. Redirects are performed only within the same site, and the assistant asks the visitor before redirecting.

Do actions require server access?

No. Actions run in the visitor's browser with their own session; no administrator password or server access is provided.

## Let's define your actions together

Let's plan which actions to define during the setup meeting based on your infrastructure.

[Request a quote](https://dblinx.net/en/teklif-iste?urun=smartoperator)[Site actions](/en/smartoperator/site-eylemleri.html)

## Related articles

- [Setup

### AI sales assistant setup for e-commerce sites: 2 lines of code

Adding an AI sales assistant to your e-commerce site starts with a two-line tag. We explain all steps from the tag to going live.

4 min read](/en/smartoperator/blog/e-ticaret-sitesine-yapay-zeka-satis-asistani-kurulumu.html)

- [Live support

### How does handover from chat to a live agent work?

A good chat assistant does not try to resolve every query itself; it hands over the conversation to your team at the right moment. We explain how handover works step by step.

5 min read](/en/smartoperator/blog/sohbetten-canli-temsilciye-devretme.html)

- [Security

### Protecting the chat bot from spam and bot traffic

An open chat window is a target for automated traffic and misuse. It is protected by message limits, robot verification, and blocking.

4 min read](/en/smartoperator/blog/sohbet-botunu-spam-ve-bot-trafiginden-korumak.html)
