Title: Tracking code on button
Last modified: August 21, 2016

---

# Tracking code on button

 *  Resolved [Melusine29](https://wordpress.org/support/users/melusine29/)
 * (@melusine29)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/tracking-code-on-button/)
 * Hi
 * Is it possible to put a tracking code on “addressSubmit” button and retrieve 
   the value of the input “addressInput”?
 * Thanks
 * [http://wordpress.org/plugins/store-locator/](http://wordpress.org/plugins/store-locator/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Melusine29](https://wordpress.org/support/users/melusine29/)
 * (@melusine29)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/tracking-code-on-button/#post-4393277)
 * Nobody ?
 *  [Gaerwn](https://wordpress.org/support/users/merllin/)
 * (@merllin)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/tracking-code-on-button/#post-4393304)
 * I’m not sure, but maybe it will work for tracking:
    open /wp-content/plugins/
   store-locator/**sl-functions.php** and on line 1208, replace
 *     ```
       $button_style.=" onclick=\"showLoadImg('show', 'loadImg');\"";
       ```
   
 * with
 *     ```
       $button_style.=" onclick=\"_gaq.push(['_trackEvent', 'Locations', 'Search locations']);\"";
       ```
   
 * _Location_ is the event category and _Search locations_ is the action
 * Use **.val()** if you want to retrieve the value of an input field:
    [.val() | jQuery API Documentation](http://api.jquery.com/val/#example-1)
 *  Thread Starter [Melusine29](https://wordpress.org/support/users/melusine29/)
 * (@melusine29)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/tracking-code-on-button/#post-4393312)
 * Ok thanks. it doesn’t work – probably because of the many quotes and double-quotes..
   
   It’s okay, my client does not want this function anyway! Thank you for your help

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Tracking code on button’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/store-locator_343c21.svg)
 * [Store Locator for WordPress with Google Maps – LotsOfLocales](https://wordpress.org/plugins/store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/store-locator/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Melusine29](https://wordpress.org/support/users/melusine29/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/tracking-code-on-button/#post-4393312)
 * Status: resolved