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

1.0.0(1y ago)531.4k↓53.5%2Apache-2.0PHPPHP &gt;=8.0

Since Dec 11Pushed 1mo 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 today

READMEChangelog (1)Dependencies (3)Versions (5)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

45

—

FairBetter than 91% of packages

Maintenance66

Regular maintenance activity

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~695 days

Total

2

Last Release

32d 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)")[![kHorozhanov](https://avatars.githubusercontent.com/u/15924598?v=4)](https://github.com/kHorozhanov "kHorozhanov (2 commits)")[![r0mantsov](https://avatars.githubusercontent.com/u/282843843?v=4)](https://github.com/r0mantsov "r0mantsov (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

1233.5k3](/packages/storyblok-php-management-api-client)

PHPackages © 2026

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