Conversion
Tracking conversions helps you to get insights of which interactions, and Guurus,
are resulting in successful purchases. After a chat has been converted, it will
be tracked on Partner Portal Interactions,
being listed with a green conversion tag. More details on the conversion can be
found on the chat details page.
Conversion feature must be enabled, please see loadFeatures initialization option
Automatic conversions
Conversion goals can be set on Partner Portal
Conversion
under Settings. When creating a conversion goal, give it a memorable name and
a target URL to trigger the conversion.
Whenever your user lands on a page that contains the URL pattern on its url, their last
chat will trigger a new conversion and be visible on Partner Portal
Conversations
Chat Button needs to be initialized in order to trigger the conversion
Example
Your user has questions about item X, so they engage on a conversation with a guuru.
After the conversation, the user decides to buy the item X and a module Y.
When the transaction is made by the user, they are redirected to a success page.
As an example, the success page is https://<company>.com/shop/order/success
An automatic conversion goal could be configured as follows:
{
name: 'Success shop order',
url: 'shop/order/success',
description: 'This is an example goal',
}
Adding value to conversions
It's also possible to add value and currency details to your conversions.
When initializing the chat button on a target page, you should use the
purchase
initialization option with your order information.
This information can be later seen on Partner Portal Conversations details page.
Manually triggered conversions
Chat Button Public Interface
exposes the method
trackPurchase.
It will trigger a conversion on the user last chat, tracking their current page url and
value and currency parameters.
Shopify Integration
Shopify imposes restrictions on third-party scripts in the checkout flow. The Shopify thank-you page is part of the Shopify Checkout, where theme scripts and third-party SDKs cannot be loaded. Only sandbox Web Pixels and Checkout UI Extension are supported, and legacy "Additional Scripts" are deprecated.
To track conversions on Shopify, you must configure a Shopify Web Pixel instead of using the standard Chat Button initialization on the checkout page.
Setting up the Web Pixel
- In your Shopify admin, go to Settings → Customer events.
- Click Add custom pixel.
- Give your pixel a name and click Add pixel.
- In the code editor, paste the JavaScript pixel code (without <script> tags), replace
"<APP_ID>"with your actual Guuru partner ID.
var analytics=api.analytics,browser=api.browser,init=api.init;
analytics.subscribe("checkout_completed", (event) => {
const value = event.data.checkout.totalPrice.amount;
const currency = event.data.checkout.currencyCode;
// Load Guuru script
const script = document.createElement("script");
script.src = "https://static.guuru.com/loader/v1.0/chat.min.js";
script.async = true;
document.head.appendChild(script);
script.onload = () => {
if (typeof window.Guuru !== "undefined") {
window.guuru = window.Guuru();
window.guuru.init({
appId: "<APP_ID>",
purchase: {
value: value,
currency: currency
}
});
}
};
});
- Click Save.
- Click Connect pixel and confirm the connection.
This code subscribes to the checkout_completed event, loads the Guuru script dynamically,
and initializes it with the purchase value and currency from the checkout data.
Testing Conversions setup
To test whether conversion tracking is correctly configured, follow these two steps:
- Start a chat: Open your website or test environment and initiate a normal GUURU chat through the chat button. Make sure the conversation is successfully created.
- Complete a purchase: After starting the chat, proceed with a purchase on your website and complete the checkout process until you reach the order confirmation (checkout completed) page or reach any other url configured as described in the Automatic conversions section.
To verify that the conversion was successfully recorded, go to the Interactions screen and check whether a green conversion label is displayed under the conversation or reach the Reporting: Conversion view.