Title: add &#8220;type=&#8221;text/javascript&#8221; to Monster Insights code?
Last modified: July 12, 2024

---

# add “type=”text/javascript” to Monster Insights code?

 *  Resolved [spaciousmind](https://wordpress.org/support/users/spaciousmind/)
 * (@spaciousmind)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/add-typetext-javascript-to-monster-insights-code/)
 * (((Hi, I read the pinned post about how to get support for the Lite version of
   the plugin but I think it’s outdated as the link for lite support just brings
   me back here. So I’ll post this hoping someone at MI will see it.)))
 * Anyway, in the event advice is given here, we are using Termageddon + Usercentrics
   and their support asked us if we could add **type=”text/javascript”** to our 
   Google Analytics code, saying:
 * “within your Google Analytics embed code, just after “<script “, can you add 
   the following: **type=”text/javascript”**? This will help ensure that particular
   script is more automatically controlled by Usercentrics”
 * Is there any way to do this, or if not, can that be added for a future release?
 * Thanks for any assistance.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fadd-typetext-javascript-to-monster-insights-code%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [chriscct7](https://wordpress.org/support/users/chriscct7/)
 * (@chriscct7)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/add-typetext-javascript-to-monster-insights-code/#post-17884875)
 * We can definitely look at that for a future release, however in the meantime,
   if you need to force text/javascript you can do so using our filter on the default
   attributes. We would recommend running this on your site using a snippet plugin
   like WPCode:
 * function ensure_script_type_attribute( $attributes ) {
    $attributes[‘type’] =‘
   text/javascript’; return $attributes;}add_filter( ‘monsterinsights_tracking_analytics_script_attributes’,‘
   ensure_script_type_attribute’ );
 *  Thread Starter [spaciousmind](https://wordpress.org/support/users/spaciousmind/)
 * (@spaciousmind)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/add-typetext-javascript-to-monster-insights-code/#post-17885032)
 * Hi Chris thanks for the quick response. We are using a plugin that allows for
   creation of snippets that you then add as a shortcode. I could create that snippet
   but then what would I do with it exactly/where would I add it?
 * Thanks

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

The topic ‘add “type=”text/javascript” to Monster Insights code?’ is closed to new
replies.

 * ![](https://ps.w.org/google-analytics-for-wordpress/assets/icon.svg?rev=2976619)
 * [MonsterInsights - Google Analytics Dashboard for WordPress (Website Stats Made Easy)](https://wordpress.org/plugins/google-analytics-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-analytics-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-analytics-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/google-analytics-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-analytics-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-analytics-for-wordpress/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [spaciousmind](https://wordpress.org/support/users/spaciousmind/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/add-typetext-javascript-to-monster-insights-code/#post-17885032)
 * Status: resolved