https://github.com/carrotquest/gatsby-plugin-carrotquest
https://github.com/carrotquest/gatsby-plugin-carrotquest
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/carrotquest/gatsby-plugin-carrotquest
- Owner: carrotquest
- Created: 2022-09-13T05:08:36.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-13T08:12:28.000Z (about 2 years ago)
- Last Synced: 2025-03-23T11:27:27.552Z (2 months ago)
- Language: JavaScript
- Size: 260 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gatsby-plugin-carrotquest
Подключите платформу для коммуникации с пользователями [Carrot quest](https://www.carrotquest.io/) к вашему сайту на Gatsby. [Зарегистрируйтесь](https://www.carrotquest.io/panel/unauthorized/login/), установка сервиса займет 7 минут.
Carrot quest поможет:
1. Собирать больше лидов с сайта и передавать их в продажи или вести дальше по воронке автоматически.
2. Организовать общение с клиентами в одном окне, отвечать на вопросы пользователей 24/7 и при этом сократить нагрузку на команду поддержки.## Установка
```shell
yarn add gatsby-plugin-carrotquest
```или
```shell
npm i gatsby-plugin-carrotquest
```
## Как использовать
Для установки [бизнес-чата](https://www.carrotquest.io/chat/) и [чат-бота](https://www.carrotquest.io/chatbot/) на ваш Gatsby сайт, вам необходимо [создать аккаунт Carrot quest](https://carrotquest.io/panel/unauthorized/register/).
После регистрации возьмите `CARROTQUEST_ID`, настройте свой файл `gatsby-config.js` как в примере:
```js
// В вашем gatsby-config.js
module.exports = {
plugins: [
{
resolve: "gatsby-plugin-carrotquest",
options: {
carrotquestId: "CARROTQUEST_ID",
mobileDelay: 2000, // Optional. Задержка для mobile devices.
desktopDelay: 500, // Optional. Задержка для other devices.
},
},
],
};
```
### Отслеживание посещения страниц для SPA
```js
// В вашем gatsby-browser.js
const isEnabledCarrotquest = () => typeof carrotquest === `object`;exports.onRouteUpdate = ({ location }) => {
if (isEnabledCarrotquest()) {
if (location.href.indexOf("/blog/") > -1) {
carrotquest.track("Просмотр блога", {
URL: location.href,
});
} else {
carrotquest.track("Просмотр страницы", {
URL: location.href,
});
}
}
};
```