Title: Adding Google Analytics event tracking
Last modified: November 15, 2016

---

# Adding Google Analytics event tracking

 *  Resolved [Andrija Kokanovic](https://wordpress.org/support/users/kokan87/)
 * (@kokan87)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-google-analytics-event-tracking/)
 * Hey guys,
 * I encountered a task of adding event tracking to subscribe forms (check out this:
   [https://developers.google.com/analytics/devguides/collection/analyticsjs/events](https://developers.google.com/analytics/devguides/collection/analyticsjs/events)).
 * I was wondering does this awesome plugin have a feature for adding the google
   analytics event tracking code? And if it doesnt – any hint on where should I 
   look? Searched your knowledge base, no results :/
 * You might also think about adding that feature in the future releases 🙂
 * Tnx in advance,
    Andrija

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

 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-google-analytics-event-tracking/#post-8448783)
 * Hi Andrija,
 * The plugin does not have built-in support for google analytics event tracking.
   However, there are a few different PHP- / WordPress-based action hooks that you
   could attach custom code to, including embedding JavaScript code. I would suggest
   checking out the process_form_submission.php page where we’ve included the following
   actions:
    `yikes-mailchimp-after-submission` `yikes-mailchimp-after-submission-
   $form_id` `yikes-mailchimp-form-submission` `yikes-mailchimp-form-submission-
   $form_id`
 * Would this help solve your current task?
 * Also, you’re not the first person to ask for Google Analytics (or similar software)
   support, so we hear you and will try to prioritize that.
 * Hope that helps,
    Kevin.
 * Edit: Andrija, I answer a similar question in this thread ([https://wordpress.org/support/topic/javascript-subscribed-event/](https://wordpress.org/support/topic/javascript-subscribed-event/))
   and thought that may be worth reading through.
    -  This reply was modified 9 years, 6 months ago by [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/).
 *  Thread Starter [Andrija Kokanovic](https://wordpress.org/support/users/kokan87/)
 * (@kokan87)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-google-analytics-event-tracking/#post-8453575)
 * Hi Kevin,
 * Thanks for the heads up, I will look into these hooks.
 * It would be very helpful to have that option _out of the box_ inside the plugin
   or at least well documented somewhere (knowledge base for example) like mc4wp
   has it.
 * Cheers,
    Andrija
 *  Plugin Contributor [Tracy Levesque](https://wordpress.org/support/users/liljimmi/)
 * (@liljimmi)
 * 🏳️‍🌈 YIKES, Inc. Co-Owner
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-google-analytics-event-tracking/#post-8465346)
 * Hi Andrija,
 * We have added this to our to-do list.
 * Thank you for the suggestion!
    -Tracy
 *  Thread Starter [Andrija Kokanovic](https://wordpress.org/support/users/kokan87/)
 * (@kokan87)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/adding-google-analytics-event-tracking/#post-8497057)
 * Tnx, Tracy, I appreciate it!
 * And for all of you that want to do this, this is how I solved it:
 * add this into functions.php (I used child theme):
 *     ```
       function whatever_you_want(){ ?>
       		<script>
       			ga('send', {
       			  hitType: 'event',
       			  eventCategory: 'Category',
       			  eventAction: 'Action',
       			  eventLabel: 'Label'
       			});
       		</script>
       	<?php 
       add_action( 'yikes-mailchimp-after-submission-1', 'whatever_you_want' );
       ```
   
 * _**NOTE:**_
    **yikes-mailchimp-after-submission-1** – Replace the last number(
   1) with the ID of your form
    -  This reply was modified 9 years, 6 months ago by [Andrija Kokanovic](https://wordpress.org/support/users/kokan87/).
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [9 years ago](https://wordpress.org/support/topic/adding-google-analytics-event-tracking/#post-9094172)
 * Hi [@kokan87](https://wordpress.org/support/users/kokan87/),
 * If you’re still looking for it, better support for Google Analytics has been 
   added.
 * Check out this article from our knowledge base: [https://yikesplugins.com/support/knowledge-base/add-google-analytics-event-tracking/](https://yikesplugins.com/support/knowledge-base/add-google-analytics-event-tracking/).
 * Cheers,
    Kevin.

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

The topic ‘Adding Google Analytics event tracking’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/yikes-inc-easy-mailchimp-extender_a1c7e5.
   svg)
 * [Easy Forms for Mailchimp](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/)
 * [Active Topics](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/reviews/)

## Tags

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

 * 5 replies
 * 3 participants
 * Last reply from: [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/adding-google-analytics-event-tracking/#post-9094172)
 * Status: resolved