private function load_google_analytics() { WooCommerce_Grow::load_google_analytics(); // We setup the Google Client object $this->client = new Google_Client(); $this->client->setAuthConfigFile(WooCommerce_Grow::get_plugin_path() . '\\ga-config.json'); $this->client->addScope(Google_Service_Analytics::ANALYTICS_READONLY); $this->analytics = new Google_Service_Analytics($this->client); }
/** * Get plugin path * * @since 1.0 * @return string */ public static function get_plugin_path() { if (null === self::$plugin_dir_path) { self::$plugin_dir_path = untrailingslashit(plugin_dir_path(__FILE__)); } return self::$plugin_dir_path; }