Title: Possible to track code copy button with Analytics?
Last modified: September 9, 2020

---

# Possible to track code copy button with Analytics?

 *  [aaronrobb](https://wordpress.org/support/users/aaronrobb/)
 * (@aaronrobb)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/possible-to-track-code-copy-button-with-analytics/)
 * Has anyone tried to set this up to track clicks on the ‘copy code’ button with
   Google Analytics?
    Possible?

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

 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/possible-to-track-code-copy-button-with-analytics/#post-13383909)
 * just add an event listener to the button
 *  Thread Starter [aaronrobb](https://wordpress.org/support/users/aaronrobb/)
 * (@aaronrobb)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/possible-to-track-code-copy-button-with-analytics/#post-13385100)
 * [@andi-dittrich](https://wordpress.org/support/users/andi-dittrich/) Thanks for
   the reply. That’s what I assumed – just have to edit the plugin code which I 
   try to not do.
    Wasn’t sure if there was a non-invasive way to do it at all.
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/possible-to-track-code-copy-button-with-analytics/#post-13386159)
 * you don’t need to edit the code. just add some vanilla javascript (or jquery)
   and match the button classname. that’s it!

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

The topic ‘Possible to track code copy button with Analytics?’ is closed to new 
replies.

 * ![](https://ps.w.org/enlighter/assets/icon-256x256.png?rev=1215872)
 * [Enlighter - Customizable Syntax Highlighter](https://wordpress.org/plugins/enlighter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enlighter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enlighter/)
 * [Active Topics](https://wordpress.org/support/plugin/enlighter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enlighter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enlighter/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/possible-to-track-code-copy-button-with-analytics/#post-13386159)
 * Status: not resolved