Title: Analytics Event Tracking
Last modified: October 24, 2017

---

# Analytics Event Tracking

 *  [kpmarz](https://wordpress.org/support/users/kpmarz/)
 * (@kpmarz)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/analytics-event-tracking-2/)
 * I am looking to add a Google Analytics event tracking script that is triggered
   when a person clicks the search button. Is there a place I can add the code snippet?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/analytics-event-tracking-2/#post-9623178)
 * There’s no build in way to do this.
 * It’s possible, but you have to be comfortable with code. Load a custom JS file
   with [wp_enqueue_script](https://developer.wordpress.org/reference/functions/wp_enqueue_script/)
   from the functions.php inside your active theme folder.
 * In the custom JS script include this.
 *     ```
       jQuery( document ).ready( function( $ ) { 
         $( "#wpsl-search-btn" ).bind( "click", function( e ) {
        // run your custom code.
         });
       ```
   
 * });
 * This is untested, but it should work.

Viewing 1 replies (of 1 total)

The topic ‘Analytics Event Tracking’ is closed to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/analytics-event-tracking-2/#post-9623178)
 * Status: not resolved