Google Tag Manager - v1.0.0

Contributing

The authoritative contribution guide lives at CONTRIBUTING.md in the package root. This page summarizes what a code contributor to artisanpack-ui/google-tag-manager specifically needs to know.

Development setup

Fork and clone the package repository, then pull it into an ArtisanPack UI dev app via a Composer path repository:

{
    "repositories": [
        {
            "type": "path",
            "url": "../artisanpack-ui-google-tag-manager",
            "options": { "symlink": true }
        }
    ],
    "require": {
        "artisanpack-ui/google-tag-manager": "@dev"
    }
}

The artisanpack-ui-dev app in the ecosystem is already wired up this way — symlinks live under packages/google-tag-manager/.

Install package dependencies:

composer install

Running the test suite

composer test

Or a filtered run:

./vendor/bin/pest --filter="the string you want to match"

See Testing for what the shipped suite covers and how to write new tests.

Code style

The package uses PHP-CS-Fixer with WordPress-style spacing plus PHPCS with the ArtisanPackUIStandard rules. Fix formatting before pushing:

composer fix     # PHP-CS-Fixer auto-fix
composer cs      # PHPCS check (no auto-fix)
composer lint    # Both, dry-run

Highlights:

  • Spaces inside parentheses / brackets (if ( $x ), [ 'k' => 'v' ])
  • Yoda comparisons (if ( true === $x ))
  • Real tabs for indentation
  • Aligned = and => in consecutive assignments
  • Single quotes for plain strings

Testing your changes end-to-end

The artisanpack-ui-dev app in the ecosystem has this package symlinked. Point a page at @gtmSnippet and open the browser network tab to confirm the container snippet loads. Use a Livewire test route to exercise the container overview / tag list Live components.

Branch conventions

  • Branch from release/1.0 for v1.x work
  • Feature branches: feature/{issue#}-{slug}
  • Bug fixes: bugfix/{issue#}-{slug}
  • Docs-only: docs/{issue#}-{slug}
  • PRs should target release/1.0 unless the issue is on a different milestone

Adding a new admin surface

If you're adding a third Livewire / React / Vue surface (say, "trigger list"), follow the pattern the existing pair uses:

  1. Add a TriggerListData DTO under src/Api/ if a new response shape is needed
  2. Add a TriggerListFetcher composing whatever TagManagerClient calls are needed
  3. Add a Livewire\TriggerList component that resolves the fetcher and follows the same HandlesTagManagerRefresh pattern
  4. Add a Http\Controllers\TriggerListController and a route in routes/web.php
  5. Add React + Vue components under resources/js/react/ and resources/js/vue/
  6. If the CMS framework should surface it, add a CmsFramework\TriggerListWidget
  7. Cover every layer with Pest tests

The tag list surface is the reference implementation — copy its structure.