PHPackages                             stape/stape-sgtm-php - 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. stape/stape-sgtm-php

ActiveLibrary[API Development](/categories/api)

stape/stape-sgtm-php
====================

Stape sGTM PHP SDK

v1.0.2(4w ago)534.8k↓53.9%2Apache-2.0PHPPHP &gt;=8.0

Since Dec 11Pushed 4w ago6 watchersCompare

[ Source](https://github.com/stape-io/stape-sgtm-php)[ Packagist](https://packagist.org/packages/stape/stape-sgtm-php)[ RSS](/packages/stape-stape-sgtm-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (6)Versions (6)Used By (0)

Stape sGTM PHP SDK
==================

[](#stape-sgtm-php-sdk)

A PHP SDK to send tracking events to server-side GTM containers. Works in conjunction with Data Client.

Getting Started
---------------

[](#getting-started)

### Configuration

[](#configuration)

Fill in the basic parameters:

```
use Stape\Sgtm\StapeSGTM;

$sgtm = StapeSGTM::create('https://gtm.example.com', '/data');
```

VariableDescription$gtmServerDomainServer host$requestPathRequest processing path### Sending Event Data

[](#sending-event-data)

```
$sgtm->sendEventData(, );
```

VariableDescription$eventNameEvent name$eventDataArray of options for forming event data**$eventData**

```
$eventData = [
  'page_hostname' => 'Stape',
  'page_location' => 'http://stape.io',
  'page_path' => '/',
  'user_data' => [
    'sha256_email_address' => Transforms::sha256hex('jhonn@doe.com'),
    'address' => [
      'first_name' => 'Jhon',
    ],
  ],
];
```

#### Transforms

[](#transforms)

OptionDescriptiontrimRemoves whitespace from the beginning and end of the valuebase64Encodes the string in Base64 formatmd5Encodes the string in MD5 formatsha256base64Encodes the string in SHA256 Base64 formatsha256hexEncodes the string in SHA256 HEX format### Full Example

[](#full-example)

```
namespace Stape\Sgtm\Example;

use Stape\Sgtm\StapeSGTM;
use Stape\Sgtm\Transforms;

require_once __DIR__  . '/../vendor/autoload.php';

$start = StapeSGTM::create('https://gtm.stape.io', '/data?dhjdf=123');

$eventData = [
    'client_id' => '123456',
    'currency' => 'USD',
    'ip_override' => '79.144.123.69',
    'language' => 'en',
    'page_encoding' => 'UTF-8',
    'page_hostname' => 'Stape',
    'page_location' => 'http://stape.io',
    'page_path' => '/',
    'user_data' => [
        'sha256_email_address' => Transforms::sha256hex('jhonn@doe.com'),
        'phone_number' => '123456769',
        'address' => [
            'first_name' => 'Jhon',
        ],
    ],
];

var_dump($start->sendEventData('page_view', $eventData));
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance94

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~371 days

Total

3

Last Release

29d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/425de1ea8b733eebc0cabb1bb4e9607be9ac037117a6853656bef7ec65a5ed2b?d=identicon)[Stape](/maintainers/Stape)

---

Top Contributors

[![Bukashk0zzz](https://avatars.githubusercontent.com/u/1908342?v=4)](https://github.com/Bukashk0zzz "Bukashk0zzz (6 commits)")[![r0mantsov](https://avatars.githubusercontent.com/u/282843843?v=4)](https://github.com/r0mantsov "r0mantsov (3 commits)")[![kHorozhanov](https://avatars.githubusercontent.com/u/15924598?v=4)](https://github.com/kHorozhanov "kHorozhanov (2 commits)")[![dmtsolovey](https://avatars.githubusercontent.com/u/104273286?v=4)](https://github.com/dmtsolovey "dmtsolovey (1 commits)")[![phpDevOleksii](https://avatars.githubusercontent.com/u/164806214?v=4)](https://github.com/phpDevOleksii "phpDevOleksii (1 commits)")

---

Tags

gtmgtm-server-sidephpsdksdk-phpstape

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/stape-stape-sgtm-php/health.svg)

```
[![Health](https://phpackages.com/badges/stape-stape-sgtm-php/health.svg)](https://phpackages.com/packages/stape-stape-sgtm-php)
```

###  Alternatives

[storyblok/php-management-api-client

Storyblok PHP Client for Management API

1337.8k6](/packages/storyblok-php-management-api-client)

PHPackages © 2026

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