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

ActiveLibrary

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

Stape sGTM PHP SDK

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

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

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

35

—

LowBetter than 80% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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

Unknown

Total

1

Last Release

680d 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)")[![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

[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

50570.7k1](/packages/web-auth-webauthn-framework)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[acquia/orca

A tool for testing a company's software packages together in the context of a realistic, functioning, best practices Drupal build

32902.4k](/packages/acquia-orca)[mahocommerce/maho

Free and open source ecommerce platform, created in 2024 on the M1 platform, PHP 8.3+

1322.1k12](/packages/mahocommerce-maho)

PHPackages © 2026

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