How it works and caveats
What askai-button hands to an AI service, how privacy is handled, why the URL formats of the AI services are unofficial, how the services differ, what to do when the AI cannot read the site, the limit on the length of the URL, and the trademark and licence notices.
Only a URL is passed
askai-button calls no AI API. It does two things only:
- It builds a short text that contains the visitor's question and the address of the site.
- It opens the page of the AI service the visitor chose, in a new tab, with an address that carries this text.
The built-in text is:
{question}
Please refer to the following URL to answer this question.
{site_url}
Only the address of the site is passed, not the content of the page. The idea is that the AI service that receives the address goes and reads the site on the spot and answers from what it finds. Whether it really does so, which pages it reads and how far, and how it answers is decided by the AI service and cannot be controlled from this button.
The address of the site is the top of the site: the origin of the page, such as https://example.com/. It is the same on every page, including the pages of a site in several languages (/en/... passes https://example.com/ too). To pass the top page of each language, set data-site-url on the pages of that language; see "Reference". The WordPress plugin has a setting for this on sites run with Polylang or WPML; see "WordPress".
The answer is generated by the AI service. Neither the owner of the site nor this button can guarantee that it is correct. The panel says so as well: "The answer is generated by that service."
Privacy
What the button itself does not do
- It makes no network requests. The only file loaded is
askai-button.min.js, and this file loads no other file. (Where that one file is loaded from is your choice; see "Where the file is loaded from" below.) - It does not store, send or measure the question.
- It uses no cookies.
- The only thing it stores in the browser is the id of the AI service the visitor chose last (the
localStoragekeyaskai-button:provider), so that the same service is selected the next time the panel is opened.
This is the JavaScript library, and it holds for the WordPress plugin with its default settings as well. The plugin has one optional feature that is off by default: it can keep monthly totals of clicks in the database of your own site. Then each click on the button or on a send button is reported to your site, and to nobody else, as a kind of click and the id of the service, without the question, the page or anything about the visitor. See "Usage counts".
Where the file is loaded from
Loading askai-button.min.js is a request like the one for any other script of a page. Who receives it depends on where you put the file:
- On your own server (also with the npm package and the WordPress plugin): the request goes to your own site. No third party is involved.
- From a public CDN such as jsDelivr or unpkg: the visitor's browser requests the file from the operator of the CDN, a third party, which receives what a browser sends with any request (the IP address and, depending on the referrer policy of your page, the address of your site). The question is not part of this request: the file is fetched when the page loads, before anything is typed.
In both cases the file is the same, and it sends nothing itself. Details are under "From a CDN" on the installation page.
What happens when the send button is pressed
When the visitor presses the send button, the visitor's browser opens the chosen AI service in a new tab. What the visitor typed leaves the page only on this action of the visitor.
- The address that is opened contains the text for the AI: the question, the fixed sentence and the address of the site. If the query template has been changed, it contains what the template says, which can include the address and the title of the current page and the name of the site.
- As with any link, the AI service also receives what a browser sends when it opens a page, such as the IP address, the cookies of that service and information about the referring page.
- For a service set to "copy and open" (
copy_and_open), the text is copied to the visitor's clipboard and the service is opened without it.
What the AI service does with the question is governed by its own terms of use and privacy policy. The visitor uses the service with their own account and settings.
What the owner of the site should know
- The server of the site does not receive the question.
- The
askai:sendevent andonSendtell you that something was sent (the id of the AI service, whether it was an example question or typed freely, and the address of the page), but never the question itself. The button sends this nowhere.
The URL formats are unofficial
To hand over the question in a URL, the q parameter of each service's URL is used.
| AI service | Built-in URL template |
|---|---|
| ChatGPT | https://chatgpt.com/?q={query} |
| Claude | https://claude.ai/new?q={query} |
| Google AI Mode | https://www.google.com/search?udm=50&q={query} |
None of these is published or guaranteed as a specification by its service. They can change or stop working without notice. The behaviour can also differ with the visitor's region, account or device (for example when the app of the service opens on a phone).
For this reason no URL template is fixed. Everything can be changed in the settings:
- Change the URL template: replace the
urlTemplateof the service. - Switch to copy and open: with
method: 'copy_and_open', the text is copied to the clipboard, the service is opened, and the visitor is asked to paste and send. This is the fallback for a service that no longer accepts a question in its URL. - Remove the service: take it out of
providers.
How to set these is described in the "Reference" and, for WordPress, under "The settings screen".
Differences between the AI services
Depending on the chosen AI service, the panel shows one of these notes:
| AI service | Note shown in the panel |
|---|---|
| ChatGPT | Your question is sent automatically. |
| Claude | Your question is filled in for you. Press send yourself. Sign-in is required. |
| Google AI Mode | Opens Google Search in AI Mode. Where AI Mode is unavailable you may see regular search results. |
Take these as a guide. The actual behaviour is decided by each service and can change. Google AI Mode in particular may be available only in some regions and for some accounts; where it is not, regular search results may be shown instead of an answer from the AI.
The notes can be changed with labels, under keys such as note.chatgpt.
When the AI cannot read the site
Only an address is passed, so if the AI service cannot read that address, it cannot answer from the content of the site. This is the case when:
robots.txtor a WAF (firewall) blocks the crawlers of AI services;- the page requires a login or HTTP basic authentication;
- the site is somewhere the internet cannot reach, such as
localhost, an internal network or a staging environment.
For this case the panel has a collapsed section, "If the AI cannot read this site". It contains a "Copy question and URL" button, so that the visitor can copy the question and the address and paste them into the AI by hand. If needed, they can paste the content of the page along with it.
As the owner of a site, check that the pages you want AI services to read are not blocked by robots.txt or similar.
The limit on the length of the URL
The question travels inside a URL, so a long question makes a long URL. A Japanese character becomes nine characters inside a URL (in the form %E3%81%82), which makes such a URL much longer than one with Latin letters and digits.
- When the resulting URL is longer than
maxUrlLength(8,000 characters by default), the send button is disabled and "Your question is too long." is shown. - A question can have up to
maxLengthcharacters (500 by default). With the default settings, a question of 500 Japanese characters still fits into 8,000 characters of URL. - The length of URL that is accepted differs between AI services and browsers. If long questions do not arrive properly, lower
maxLengthormaxUrlLength, or set that service to "copy and open".
Trademarks
ChatGPT, Claude and Google are trademarks of their respective owners. This project is not affiliated with OpenAI, Anthropic or Google, and is not sponsored or endorsed by any of them.
No logos of the AI services are used. The panel shows each service by its name in text.
Licence
- The JavaScript library (askai-button, npm package
@elephancube/askai-button): MIT License - The WordPress plugin (Elephancube Ask AI Button): GPL-2.0-or-later. The library file bundled with it is under the MIT License.
Copyright (c) 2026 Elephancube Inc.
The source code and the full licence texts are in the GitHub repository. The project is free to use and has no paid version. Support is given on a best-effort basis. Bugs can be reported in the Issues of the repository.