Search…

X3 Photo Gallery Support Forums

Search…
 
morgenius
Experienced
Topic Author
Posts: 40
Joined: 20 Aug 2014, 04:41

Chatra service small bug

19 Mar 2019, 12:44

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?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12195
Joined: 30 Sep 2006, 03:37

Re: Chatra service small bug

20 Mar 2019, 00:37

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.
 
morgenius
Experienced
Topic Author
Posts: 40
Joined: 20 Aug 2014, 04:41

Re: Chatra service small bug

20 Mar 2019, 04:41

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.
 
morgenius
Experienced
Topic Author
Posts: 40
Joined: 20 Aug 2014, 04:41

Re: Chatra service small bug

20 Mar 2019, 05:33

This is an answer from Chatra team:

For this we have the pageView method in the API.
https://chatra.io/help/api/#pageview
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12195
Joined: 30 Sep 2006, 03:37

Re: Chatra service small bug

20 Mar 2019, 05:58

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.
 
morgenius
Experienced
Topic Author
Posts: 40
Joined: 20 Aug 2014, 04:41

Re: Chatra service small bug

20 Mar 2019, 06:17

Great, Karl!

It's works!! :))

Thank you!!!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12195
Joined: 30 Sep 2006, 03:37

Re: Chatra service small bug

28 Mar 2020, 21:31

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.