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(11y ago)51.9k2MITPHPPHP &gt;=5.3

Since Apr 20Pushed 11y ago1 watchersCompare

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

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 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

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

4036d 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

[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[tomshaw/google-api

A Laravel Google API Client.

601.8k](/packages/tomshaw-google-api)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[spatie/analytics-statistics

An opinionated php package to retrieve Google Analytics data.

794.8k](/packages/spatie-analytics-statistics)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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