Page 1 of 1

Chatra service small bug

Posted: 19 Mar 2019, 12:44
by morgenius
Hello, Karl!

I've found a small problem with Chatra service. The service has a setting: open a chat window when user actions satisfy certain conditions. But this is not happening on my website www.morgunov.ru. I received a response from Chatra support service:

"The developers have found that on your websites page navigation occurs without reloading, therefore Chatra does not consider them as separate pages. To get the triggers to work, you need to call our Chatra ('pageView') method somewhere in the code after changing the page. If you have a developer in the team, you can give it to him."

Can you fix this problem?

Re: Chatra service small bug

Posted: 20 Mar 2019, 00:37
by mjau-mjau
Hi,

First of all, I am not quite sure what you mean "open a chat window when user actions satisfy certain conditions.". What conditions? Also, I see that you have manually integrated Chatra, instead of simply adding your Chatra ID to Settings > Plugins > Chatra. This might not be crucial, but it was added so that X3 has better control of the chatra plugin.
Image 

Yes, X3 is an "AJAX" app and technically a "single-page application", and therefore many 3rd party Javascripts won't just work if they need to re-trigger for each page. Instead, these plugins should provide API's to be able to manually trigger actions after dynamic page load complete in X3.

Re: Chatra service small bug

Posted: 20 Mar 2019, 04:41
by morgenius
Yes, I know about integrated Chatra service in X3. I've used this option already, but I've got a same result.

"Satisfy certain conditions" - for example, I mean:
- browsed pages per visit
- time on website
- previous page address
- number of all pages viewed

When any of these conditions or a combination of conditions is fulfilled, the chat window automatically opens and pops up a message from the bot.

Re: Chatra service small bug

Posted: 20 Mar 2019, 05:33
by morgenius
This is an answer from Chatra team:

For this we have the pageView method in the API.
https://chatra.io/help/api/#pageview

Re: Chatra service small bug

Posted: 20 Mar 2019, 05:58
by mjau-mjau
Ok. Basically you can add the following to Settings > Custom > Custom Javascript:
Code
function x3_load_page(){
  if(typeof Chatra != 'undefined') Chatra('pageView');
}
It will trigger Chatra('pageView') for every virtual page view.

Re: Chatra service small bug

Posted: 20 Mar 2019, 06:17
by morgenius
Great, Karl!

It's works!! :))

Thank you!!!

Re: Chatra service small bug

Posted: 28 Mar 2020, 21:31
by mjau-mjau
In latest X3.28.0 release, Chatra pageview tracking is built-in. After updating, you can remove the custom javascript code noted in my earlier post.