Title: [Plugin: Google Analytics Dashboard] Custom wp-content support
Last modified: August 19, 2016

---

# [Plugin: Google Analytics Dashboard] Custom wp-content support

 *  Resolved [geminorum](https://wordpress.org/support/users/geminorum/)
 * (@geminorum)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/)
 * The plugin does not support custom wp-content as :
    [http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content](http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content)
   so cannot include gad_main.js.php on my install of wp.
 * suggesting :
    define( ‘GAD_DIR’, plugin_dir_path( __FILE__ ) ); define( ‘GAD_URL’,
   plugin_dir_url( __FILE__ ) ); on main plugin file. thx btw.
 * [http://wordpress.org/extend/plugins/google-analytics-dashboard/](http://wordpress.org/extend/plugins/google-analytics-dashboard/)

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

 *  Plugin Contributor [Carson McDonald](https://wordpress.org/support/users/carson-mcdonald/)
 * (@carson-mcdonald)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/#post-1936400)
 * I have made another update that I think should address this by using the built
   in way of finding the admin URL. If you would try the 2.0.2 version and let me
   know if it works.
 *  Thread Starter [geminorum](https://wordpress.org/support/users/geminorum/)
 * (@geminorum)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/#post-1936403)
 * the gad_main.js.php includes correctly on 2.0.2, but I get fatal in the gad_main.
   js.php for including wp-config.php
 *  Plugin Contributor [Carson McDonald](https://wordpress.org/support/users/carson-mcdonald/)
 * (@carson-mcdonald)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/#post-1936404)
 * Can you give me an idea of where wp-config.php is in relationship to the plugin
   directory? I’ll need to see how best to do that. Curse the WP examples for not
   doing it in a way that works for everyone, I didn’t know people moved the content
   dir.
 *  Thread Starter [geminorum](https://wordpress.org/support/users/geminorum/)
 * (@geminorum)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/#post-1936405)
 *     ```
       if ( file_exists( ABSPATH . 'wp-config.php') ) {
       	/** The config file resides in ABSPATH */
       	require_once( ABSPATH . 'wp-config.php' );
       } elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) && ! file_exists( dirname(ABSPATH) . '/wp-settings.php' ) ) {
       	/** The config file resides one level above ABSPATH but is not part of another install*/
       	require_once( dirname(ABSPATH) . '/wp-config.php' );
       }
       ```
   
 * form wp-load.php
 * p.s. I don’t think that’s working for the AJAX! I’ll see other plugins.
 *  Thread Starter [geminorum](https://wordpress.org/support/users/geminorum/)
 * (@geminorum)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/#post-1936406)
 * I think the better approach is to get _gad\_get\_admin\_url(‘/admin-ajax.php’);_
   via a JS var into the code by printing on the <head>, link gad_main.js.php content
   as regular script and then call the function with the var.
 *  Thread Starter [geminorum](https://wordpress.org/support/users/geminorum/)
 * (@geminorum)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/#post-1936407)
 * And besides, by using .js.php method, the plugin waste resources by making unnecessary
   calls.
 *  Plugin Contributor [Carson McDonald](https://wordpress.org/support/users/carson-mcdonald/)
 * (@carson-mcdonald)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/#post-1936476)
 * After your suggestion I dug a little more and there is an ajaxurl javascript 
   variable that seems to be the key. I have updated the plugin again to incorporate
   that and get rid of the need for the php generation. I hope that will fix a number
   of odd issues people have been seeing. Can you see if this also resolves the 
   issue of having wp-content in a different location? I have about 9 different 
   WP installs now and this is a setup I still didn’t have time to try.
 *  Thread Starter [geminorum](https://wordpress.org/support/users/geminorum/)
 * (@geminorum)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/#post-1936479)
 * 2.0.3 works like a charm.
    thank you for the support.
 *  Plugin Contributor [Carson McDonald](https://wordpress.org/support/users/carson-mcdonald/)
 * (@carson-mcdonald)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/#post-1936481)
 * No problem.

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

The topic ‘[Plugin: Google Analytics Dashboard] Custom wp-content support’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/google-analytics-dashboard.svg)
 * [Google Analytics Dashboard](https://wordpress.org/plugins/google-analytics-dashboard/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-analytics-dashboard/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-analytics-dashboard/)
 * [Active Topics](https://wordpress.org/support/plugin/google-analytics-dashboard/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-analytics-dashboard/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-analytics-dashboard/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Carson McDonald](https://wordpress.org/support/users/carson-mcdonald/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-google-analytics-dashboard-custom-wp-content-support/#post-1936481)
 * Status: resolved