Title: Trigger Javascript on comment submission
Last modified: August 19, 2016

---

# Trigger Javascript on comment submission

 *  [David Wang](https://wordpress.org/support/users/blogjunkie/)
 * (@blogjunkie)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/trigger-javascript-on-comment-submission/)
 * I’m trying to develop my first plugin and would like your help. The plugin’s 
   function is to trigger a JavaScript function (Google Analytics tracking code)
   when a comment is submitted.
 * I found the comment_post_redirect filter in the Filter/Hook reference ([http://codex.wordpress.org/Plugin_API/Filter_Reference#Comment.2C_Trackback.2C_and_Ping_Filters](http://codex.wordpress.org/Plugin_API/Filter_Reference#Comment.2C_Trackback.2C_and_Ping_Filters))
   which seems to be ideal but there’s no instructions on how to use them. 
 * Can someone point me in the right direction? Where do I start? 

The topic ‘Trigger Javascript on comment submission’ is closed to new replies.

## Tags

 * [comment](https://wordpress.org/support/topic-tag/comment/)

 * 0 replies
 * 1 participant
 * Last reply from: [David Wang](https://wordpress.org/support/users/blogjunkie/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/trigger-javascript-on-comment-submission/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
