PHPackages                             hametuha/gapiwp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hametuha/gapiwp

ActiveLibrary[API Development](/categories/api)

hametuha/gapiwp
===============

Google API Library wrapper for WordPress.

1.0.3(10y ago)51.8k2MITPHPPHP &gt;=5.3

Since Apr 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/hametuha/gapiwp)[ Packagist](https://packagist.org/packages/hametuha/gapiwp)[ RSS](/packages/hametuha-gapiwp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

gapiwp
======

[](#gapiwp)

Google API Library wrapper for WordPress.

How to use
----------

[](#how-to-use)

### Install

[](#install)

Install this libary in your theme or plugin via Composer.

To do so, you need write `commposer.json` like below.

```
{
  "name": "your-name/your-theme",
  "description": "WordPress theme",
  "require": {
    "hametuha/gapiwp": "1.0.x"
  }
}
```

Now you can execute `composer install`. [Google API Client](https://github.com/google/google-api-php-client) is a bit bigger library, `--no-dev` option is recommended.

```
composer install --no-dev

```

### Load library

[](#load-library)

In your entry point( theme's functions.php or plugin's base file), initialize library.

```
// Load auto loader.
include __DIR__.'/vendor/autoload.php';
// Initialize library
\Hametuha\GapiWP\Loader::load();
```

Googla Analytics
================

[](#googla-analytics)

Currently, only Google Analytics API is supported. You can now easily contact with Google Analytics data.

After initliazing the library, you can see setting screen on admin panel. Go to **Setting &gt; Analytics Setting**.

What you should enter is...

- Client ID
- Client secret

You can get them on [Google Developers console](https://console.developers.google.com). Besides that, you have to save your admin screen URL(e.g. `http://local.sample.in/wp-admin//options-general.php?page=gapiwp-analytics`) as redirect URI. It will be treated as white-listed.

```
// Get Google Analytics client.
$ga = \Hametuha\GapiWP\Loader::analytics();
// Get top 100 pave views of this year.
$result = $ga->fetch('2015-01-01', date_i18n('Y-m-d'), 'ga:pageviews', array(
	'max-results' => 100,
	'dimensions'  => 'ga:pagePath',
	'sort' => '-ga:pageviews'
));
// See what is retrieved.
var_dump($result);
exit;
```

[![GapiWP](https://camo.githubusercontent.com/8bb5d03830cf46b5ad9a2aaac1776c81eb423efd7570a16dd8b8cb5ea947c1b7/687474703a2f2f696d672e796f75747562652e636f6d2f76692f6138674d4271315a335a412f302e6a7067)](https://www.youtube.com/watch?v=a8gMBq1Z3ZA)

Lisence
-------

[](#lisence)

Released under MIT lisence. See LISENCE.md.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~18 days

Total

4

Last Release

3985d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/84587?v=4)[Takahashi Fumiki](/maintainers/fumikito)[@fumikito](https://github.com/fumikito)

---

Top Contributors

[![fumikito](https://avatars.githubusercontent.com/u/84587?v=4)](https://github.com/fumikito "fumikito (10 commits)")

### Embed Badge

![Health badge](/badges/hametuha-gapiwp/health.svg)

```
[![Health](https://phpackages.com/badges/hametuha-gapiwp/health.svg)](https://phpackages.com/packages/hametuha-gapiwp)
```

###  Alternatives

[revolution/laravel-google-sheets

Google Sheets API v4

4483.1M6](/packages/revolution-laravel-google-sheets)[pulkitjalan/google-apiclient

Google api php client wrapper with Cloud Platform and Laravel support

2582.9M5](/packages/pulkitjalan-google-apiclient)[dacastro4/laravel-gmail

Gmail API package for Laravel

312382.9k1](/packages/dacastro4-laravel-gmail)[spotonlive/php-google-my-business

Google MyBusiness

31677.1k](/packages/spotonlive-php-google-my-business)[happyr/google-api-bundle

A Symfony2 Wrapper for the Google APIs Client Library for PHP

48196.1k](/packages/happyr-google-api-bundle)[mediafigaro/google-analytics-api-symfony

Google Analytics API v4 Symfony

46177.7k](/packages/mediafigaro-google-analytics-api-symfony)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
