Title: Feature Request: Custom GA Code filter
Last modified: September 27, 2017

---

# Feature Request: Custom GA Code filter

 *  Resolved [AJ Michels](https://wordpress.org/support/users/ajmichels/)
 * (@ajmichels)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/feature-request-custom-ga-code-filter/)
 * It would be great to have a filter around the custom GA code output so that when
   writing themes and plugins it is possible to programmatically modify data that
   is being sent to GA.
 * A change such the following at lines [102](https://plugins.trac.wordpress.org/browser/ga-google-analytics/tags/20170324/ga-google-analytics.php#L102)
   and [114](https://plugins.trac.wordpress.org/browser/ga-google-analytics/tags/20170324/ga-google-analytics.php#L114):
 * `if ($gap_custom_code) echo apply_filters('gap_custom_code', $gap_custom_code)."\
   n\t\t\t";`
 * This would be really helpful.
    -  This topic was modified 8 years, 8 months ago by [AJ Michels](https://wordpress.org/support/users/ajmichels/).
    -  This topic was modified 8 years, 8 months ago by [AJ Michels](https://wordpress.org/support/users/ajmichels/).
      Reason: fix typo in snippet

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

 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/feature-request-custom-ga-code-filter/#post-9536237)
 * Excellent idea, AJ.
 * Will add something like this in the next plugin update.
 * Thank you for the feedback.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/feature-request-custom-ga-code-filter/#post-9608236)
 * Just to follow up with this. I’ve added a filter hook `gap_custom_code` for the
   output of the “Custom GA Code” setting. Thanks again for your feedback, AJ.

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

The topic ‘Feature Request: Custom GA Code filter’ is closed to new replies.

 * ![](https://ps.w.org/ga-google-analytics/assets/icon-256x256.png?rev=2053004)
 * [GA Google Analytics – Connect Google Analytics to WordPress](https://wordpress.org/plugins/ga-google-analytics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ga-google-analytics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ga-google-analytics/)
 * [Active Topics](https://wordpress.org/support/plugin/ga-google-analytics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ga-google-analytics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ga-google-analytics/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/feature-request-custom-ga-code-filter/#post-9608236)
 * Status: resolved