monsterinsights_get_registered_settings

Retrieve the array of plugin settings.

Description

(array) monsterinsights_get_registered_settings(); 

Returns (array)


Usage

  1. if ( !function_exists( 'monsterinsights_get_registered_settings' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/admin/settings/register-settings.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = monsterinsights_get_registered_settings(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/admin/settings/register-settings.php  
  1. function monsterinsights_get_registered_settings() { 
  2.  
  3. /** 
  4. * 'Whitelisted' MonsterInsights settings, filters are provided for each settings 
  5. * section to allow extensions and other plugins to add their own settings 
  6. */ 
  7.  
  8. /** 
  9. * Developers Warning: MonsterInsights does not guarantee backwards compatiblity 
  10. * of settings or tabs. We may add/remove settings and/or tabs, or re-arrange the  
  11. * settings panel as we need to. We provide these filters here right now for internal use only. 
  12. * As such the filters below may be removed or altered at any time, without advance 
  13. * warning or announcement. You've been warned.  
  14. * We will eventually promise backwards compatibility on these filters below but we want to ensure 
  15. * for the first few major releases after 6.0 we do that the current settings arrangement won't stifle 
  16. * our development progress. Once we're confident we've made the correct decision on settings layout,  
  17. * we'll remove this notice, and only at that point should you rely on the filters below. 
  18. */ 
  19. $monsterinsights_settings = array( 
  20. /** Engagement Settings */ 
  21. 'engagement' => apply_filters( 'monsterinsights_settings_engagement',  
  22. array( 
  23. 'ignore_users' => array( 
  24. 'id' => 'ignore_users',  
  25. 'name' => __( 'Ignore these user roles from tracking:', 'google-analytics-for-wordpress' ),  
  26. 'desc' => __( 'Users that have at least one of these roles will not be tracked into Google Analytics.', 'google-analytics-for-wordpress' ),  
  27. 'type' => 'select',  
  28. 'options' => monsterinsights_get_roles(),  
  29. 'select2' => true,  
  30. 'multiple' => true,  
  31. 'allowclear' => true,  
  32. ),  
  33. 'events_mode' => array( 
  34. 'id' => 'events_mode',  
  35. 'name' => __( 'Track outbound clicks and download links?', 'google-analytics-for-wordpress' ),  
  36. 'desc' => __( 'We recommend tracking clicks and downloads, so you know where users are exiting your site, and what downloads they are interacting with. ', 'google-analytics-for-wordpress', 'google-analytics-for-wordpress' ),  
  37. 'type' => 'radio',  
  38. 'std' => 'js',  
  39. 'options' => array( 
  40. 'none' => __( 'No', 'google-analytics-for-wordpress' ),  
  41. 'php' => __( 'Yes, using PHP (deprecated)', 'google-analytics-for-wordpress' ),  
  42. 'js' => __( 'Using Javascript (recommended)', 'google-analytics-for-wordpress' ),  
  43. ),  
  44. ),  
  45. ),  
  46. /** Demographics Settings */ 
  47. 'demographics' => apply_filters('monsterinsights_settings_demographics',  
  48. array( 
  49. 'demographics' => array( 
  50. 'id' => 'demographics',  
  51. 'name' => __( 'Enable Demographics and Interests Reports for Remarketing and Advertising', 'google-analytics-for-wordpress' ),  
  52. 'desc' => sprintf( esc_html__( 'Check this setting to add the Demographics and Remarketing features to your Google Analytics tracking code. Make sure to enable Demographics and Remarketing in your Google Analaytics account. We have a guide for how to do that in our %1$sknowledge base%2$s. For more information about Remarketing, we refer you to %3$sGoogle\'s documentation%2$s.', 'google-analytics-for-wordpress. Note that usage of this function is affected by privacy and cookie laws around the world. Be sure to follow the laws that affect your target audience.' ), '<a href="https://www.monsterinsights.com/docs/enable-demographics-and-interests-report-in-google-analytics/#utm_medium=kb-link&utm_source=gawp-config&utm_campaign=wpgaplugin" target="_blank" rel="noopener noreferrer" referrer="no-referrer">',  
  53. '</a>', '<a href="https://support.google.com/analytics/answer/2444872?hl=' . get_locale() . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">' 
  54. ),  
  55. 'type' => 'checkbox',  
  56. ),  
  57. 'anonymize_ips' => array( 
  58. 'id' => 'anonymize_ips',  
  59. 'name' => __( 'Anonymize IP addresses?', 'google-analytics-for-wordpress' ),  
  60. 'desc' => sprintf( esc_html__( 'This adds %1$s, telling Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApi_gat?csw=1#_gat._anonymizeIp" target="_blank" rel="noopener noreferrer" referrer="no-referrer"><code>_anonymizeIp</code></a>' ),  
  61. 'type' => 'checkbox',  
  62. ),  
  63. ),  
  64. /** Enhanced Link Attribution Settings */ 
  65. 'links' => apply_filters('monsterinsights_settings_links',  
  66. array( 
  67. 'enhanced_link_attribution' => array( 
  68. 'id' => 'enhanced_link_attribution',  
  69. 'name' => __( 'Enable enhanced link attribution?', 'google-analytics-for-wordpress' ),  
  70. 'desc' => sprintf( esc_html__( 'Add %1$sEnhanced Link Attribution%2$s to your tracking code.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', ' </a>' ),  
  71. 'type' => 'checkbox',  
  72. ),  
  73. 'hash_tracking' => array( 
  74. 'id' => 'hash_tracking',  
  75. 'name' => __( 'Turn on anchor tracking (beta; see description)', 'google-analytics-for-wordpress' ),  
  76. 'desc' => esc_html__( 'Many WordPress "1-page" style themes rely on anchor tags for navigation to show virtual pages. The problem is that to Google Analytics, these are all just a single page, and it makes it hard to get meaningful statistics about pages viewed. This experimental MonsterInsights feature allows for the tracking of anchor links as pages in Google Analytics. As a beta, first-look feature, we\'re adding a setting to turn this functionality on so we can collect feedback from people that want to use it. We may tweak or remove this feature at any time. Note: This feature tracks all anchor links as pages, without the ability to opt a particular anchor tag out currently, so only use this if you are using a "1-page" style WordPress theme', 'google-analytics-for-wordpress' ),  
  77. 'type' => 'checkbox',  
  78. ),  
  79. 'allow_anchor' => array( 
  80. 'id' => 'allow_anchor',  
  81. 'name' => __( 'Turn on allowAnchor', 'google-analytics-for-wordpress' ),  
  82. 'desc' => sprintf( esc_html__( 'This adds a %1$s call to your tracking code, and makes RSS link tagging use a %2$s as well.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiCampaignTracking?csw=1#_gat.GA_Tracker_._setAllowAnchor" target="_blank" rel="noopener noreferrer" referrer="no-referrer"><code>_setAllowAnchor</code></a>', '<code>#</code>' ),  
  83. 'type' => 'checkbox',  
  84. ),  
  85. 'add_allow_linker' => array( 
  86. 'id' => 'add_allow_linker',  
  87. 'name' => __( 'Turn on allowLinker', 'google-analytics-for-wordpress' ),  
  88. 'desc' => sprintf( esc_html__( 'This adds a %1$s call to your tracking code, allowing you to use %2$s and related functions.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiDomainDirectory?csw=1#_gat.GA_Tracker_._setAllowLinker" target="_blank" rel="noopener noreferrer" referrer="no-referrer"><code>_setAllowLinker</code></a>', ' <code>_link</code>' ),  
  89. 'type' => 'checkbox',  
  90. ),  
  91. 'tag_links_in_rss' => array( 
  92. 'id' => 'tag_links_in_rss',  
  93. 'name' => __( 'Turn on tag links in RSS', 'google-analytics-for-wordpress' ),  
  94. 'desc' => sprintf( esc_html__( 'Do not use this feature if you use FeedBurner, as FeedBurner can do this automatically and better than this plugin can. Check %1$sthis help page%2$s for info on how to enable this feature in FeedBurner.', 'google-analytics-for-wordpress' ), '<a href="https://support.google.com/feedburner/answer/165769?hl=en&ref_topic=13075" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ),  
  95. 'type' => 'checkbox',  
  96. ),  
  97. ),  
  98. /** File Download Settings */ 
  99. 'files' => apply_filters('monsterinsights_settings_files',  
  100. array( 
  101. 'track_download_as' => array( 
  102. 'id' => 'track_download_as',  
  103. 'name' => __( 'Track downloads as an:', 'google-analytics-for-wordpress' ),  
  104. 'desc' => __( 'Tracking as pageviews is not recommended, as this would skew your statistics, but it does make it possible to track downloads as goals. This feature requires that event tracking be turned on.', 'google-analytics-for-wordpress' ),  
  105. 'type' => 'radio',  
  106. 'std' => 'event',  
  107. 'options' => array( 
  108. 'event' => __( 'Event (recommended)', 'google-analytics-for-wordpress' ),  
  109. 'pageview' => __( 'Pageview', 'google-analytics-for-wordpress' ) 
  110. ),  
  111. ),  
  112. 'extensions_of_files' => array( /** @todo: Select2 extensions of files */ 
  113. 'id' => 'extensions_of_files',  
  114. 'name' => __( 'Extensions of files to track as downloads:', 'google-analytics-for-wordpress' ),  
  115. 'desc' => __( 'If you have enabled event tracking, MonsterInsights will send an event/pageview to GA if a link to a local file has one of the above extensions.', 'google-analytics-for-wordpress' ),  
  116. 'type' => 'text',  
  117. ),  
  118. ),  
  119. /** Affiliate Tracking Settings */ 
  120. 'affiliates' => apply_filters('monsterinsights_settings_affiliates',  
  121. array( 
  122. 'track_internal_as_outbound' => array( 
  123. 'id' => 'track_internal_as_outbound',  
  124. 'name' => __( 'Set path for internal links to track as outbound links', 'google-analytics-for-wordpress' ),  
  125. 'desc' => sprintf( esc_html__( 'If you want to track all internal links that begin with %1$s, enter %1$s in the box above. If you have multiple prefixes you can separate them with comma\'s: %2$s', 'google-analytics-for-wordpress' ), '<code>/out/</code>', '<code>/out/, /recommends/</code>' ),  
  126. 'type' => 'text',  
  127. ),  
  128. 'track_internal_as_label' => array( 
  129. 'id' => 'track_internal_as_label',  
  130. 'name' => __( 'Label for those links:', 'google-analytics-for-wordpress' ),  
  131. 'desc' => sprintf( esc_html__( 'The label to use for these links, this will be added to where the click came from, so if the label is %s, the label for a click from the content of an article becomes "outbound-article-aff".', 'google-analytics-for-wordpress' ), '"aff"' ),  
  132. 'type' => 'text',  
  133. ),  
  134. ),  
  135. /** Social Tracking Settings */ 
  136. 'social' => apply_filters('monsterinsights_settings_social',  
  137. array() 
  138. ),  
  139. /** Ad Tracking Settings */ 
  140. 'ads' => apply_filters('monsterinsights_settings_ads',  
  141. array() 
  142. ),  
  143. /** Forms Tracking Settings */ 
  144. 'forms' => apply_filters('monsterinsights_settings_forms',  
  145. array() 
  146. ),  
  147. /** eCommerce Tracking Settings */ 
  148. 'ecommerce' => apply_filters('monsterinsights_settings_ecommerce',  
  149. array() 
  150. ),  
  151. /** Media Tracking Settings */ 
  152. 'media' => apply_filters('monsterinsights_settings_media',  
  153. array() 
  154. ),  
  155. /** Members Tracking Settings */ 
  156. 'memberships' => apply_filters('monsterinsights_settings_memberships',  
  157. array() 
  158. ),  
  159. /** Dimensions Tracking Settings */ 
  160. 'dimensions' => apply_filters('monsterinsights_settings_dimensions',  
  161. array() 
  162. ),  
  163. /** Performance Tracking Settings */ 
  164. 'performance' => apply_filters('monsterinsights_settings_performance',  
  165. array() 
  166. ),  
  167. /** Reporting Tracking Settings */ 
  168. 'reporting' => apply_filters('monsterinsights_settings_reporting',  
  169. array() 
  170. ),  
  171. /** Notifications Tracking Settings */ 
  172. 'notifications' => apply_filters('monsterinsights_settings_notifications',  
  173. array() 
  174. ),  
  175. /** Compatibility Tracking Settings */ 
  176. 'compatibility' => apply_filters('monsterinsights_settings_compatibility',  
  177. array( 
  178. 'subdomain_tracking' => array( 
  179. 'id' => 'subdomain_tracking',  
  180. 'name' => __( 'Domain to track as:', 'google-analytics-for-wordpress' ),  
  181. 'desc' => sprintf( esc_html__( 'This allows you to %1$sset the domain%2$s that\'s used for tracking. Only is used if set to a value, else defaults to automatic determination. It is very rare that you would need to use this setting.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/tracking-snippet-reference" target="_blank" rel="noopener noreferrer" referrer="no-referrer">' , '</a>' ),  
  182. 'type' => 'text',  
  183. ),  
  184. 'custom_code' => array( 
  185. 'id' => 'custom_code',  
  186. 'name' => __( 'Custom code', 'google-analytics-for-wordpress' ),  
  187. 'desc' => sprintf( esc_html__( 'Not for the average user: this allows you to add a line of code, to be added before the %1$s call.', 'google-analytics-for-wordpress' ), '<a href="https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_gat.GA_Tracker_._trackPageview" target="_blank" rel="noopener noreferrer" referrer="no-referrer"><code>_trackPageview</code></a>' ),  
  188. 'type' => 'unfiltered_textarea',  
  189. ),  
  190. 'debug_mode' => array( 
  191. 'id' => 'debug_mode',  
  192. 'name' => __( 'Enable Debug Mode', 'google-analytics-for-wordpress' ),  
  193. 'desc' => __( 'Turns on debugging in JS events tracking, logging of eCommercerequestsand enables debug settings.', 'google-analytics-for-wordpress'),  
  194. 'type' => 'checkbox',  
  195. ),  
  196. ),  
  197. /** Permissions Tracking Settings */ 
  198. 'permissions' => apply_filters('monsterinsights_settings_permissions',  
  199. array( 
  200. 'view_reports' => array( 
  201. 'id' => 'view_reports',  
  202. 'name' => __( 'Let these user roles see reports (and the dashboard):', 'google-analytics-for-wordpress' ),  
  203. 'desc' => sprintf( esc_html( 'Users that have at least one of these roles will be able to view the reports and dashboard, along with any user with the %s capability.', 'google-analytics-for-wordpress' ), '<code>manage_options</code>'),  
  204. 'type' => 'select',  
  205. 'options' => monsterinsights_get_roles(),  
  206. 'select2' => true,  
  207. 'multiple' => true,  
  208. 'allowclear' => true 
  209. ),  
  210. 'save_settings' => array( 
  211. 'id' => 'save_settings',  
  212. 'name' => __( 'Let these user roles save settings:', 'google-analytics-for-wordpress' ),  
  213. 'desc' => sprintf( esc_html__( 'Users that have at least one of these roles will be able to view and save the settings panel, along with any user with the %s capability.', 'google-analytics-for-wordpress'), '<code>manage_options</code>' ),  
  214. 'type' => 'select',  
  215. 'options' => monsterinsights_get_roles(),  
  216. 'select2' => true,  
  217. 'multiple' => true,  
  218. 'allowclear' => true 
  219. ),  
  220. 'anonymous_data' => array( 
  221. 'id' => 'anonymous_data',  
  222. 'name' => __( 'Allow Usage Tracking', 'google-analytics-for-wordpress' ),  
  223. 'desc' => __( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' ),  
  224. 'type' => 'checkbox',  
  225. ),  
  226. ),  
  227. ); 
  228. return apply_filters( 'monsterinsights_registered_settings', $monsterinsights_settings );