Rich-text Reply

Gesture detect

rin 02-22-16

Gesture detect

Hi all,

I'm trying to setup an ab test that detects the pinch gesture. Looking for a solution on I found this article but the code doesn't work.

I'm afraid that gestures events are not compatible with jQuery 1.6.

Anyone could help me please? 


Thanks a lot!



Level 1

DavidS 02-23-16

Re: Gesture detect

Hi rin,


Thanks for reaching out!


I am not sure of what you are trying to do. It looks like you are trying to trigger a goal when a gesture event (such as tap) is detected on an element. Is this correct?

If this is correct, you will want to set up a custom event goal in Optimizely that gets called when the tap is recorded.


Regarding how to detect gestures using jQuery, I have found two resources that may help you, however I haven't tested them yet :

  • The touchSwipe plugin that will detect when a visitor swipes or pinches and then trigger an event based on the swipe direction and distance.
  • jGestures, a jQuery plugin that will allow you to manage gesture events and record when they occur.
    The idea is to detect a gesture event using any of those plugins and when this happens you'd trigger the Optimizely goal you want to fire.

I hope that is helpful!
Let me know if you need to detect gestures in another context.


Best regards,

Technical Support Representative
Optimizely - EMEA