PHPackages                             suarez/statamic-utm-parameter - 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. suarez/statamic-utm-parameter

ActiveLibrary

suarez/statamic-utm-parameter
=============================

A helper to store and handle UTM parameters on Statamic websites

6.0.0(1mo ago)028↓100%PHPCI passing

Since Jun 18Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/toni-suarez/statamic-utm-parameter)[ Packagist](https://packagist.org/packages/suarez/statamic-utm-parameter)[ Docs](https://github.com/toni-suarez/statamic-utm-parameter)[ GitHub Sponsors](https://github.com/toni-suarez)[ RSS](/packages/suarez-statamic-utm-parameter/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (3)Versions (12)Used By (0)

Statamic UTM-Parameters
=======================

[](#statamic-utm-parameters)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5c9bb87ad2ff9aea483ce40758482d032fd02d0a993d82dc96adfb4830a1d4c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73756172657a2f73746174616d69632d75746d2d706172616d657465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/suarez/statamic-utm-parameter)[![StyleCI](https://camo.githubusercontent.com/c194278576882629631059395104cc44f523765e9ccdf7269b71dbbd909a3b32/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3434383334373137382f736869656c643f6272616e63683d6d61696e)](https://github.styleci.io/repos/816752437?branch=main)[![Test PHP 8.x](https://github.com/toni-suarez/statamic-utm-parameter/actions/workflows/tests-php8.yml/badge.svg?branch=main)](https://github.com/toni-suarez/statamic-utm-parameter/actions/workflows/tests-php8.yml)[![Packagist Downloads](https://camo.githubusercontent.com/ddf2cad88dbfc859a7a36c58f2633ad62f19f8cf8e7ab6bf11d17b3b4df74f30/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73756172657a2f73746174616d69632d75746d2d706172616d657465723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/suarez/statamic-utm-parameter)[![Statamic Addon](https://camo.githubusercontent.com/fd3c994644541d8d3927f412e74a2972abacf09b38bab4c5710bb80d31923ea7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f687474707325334125324625324673746174616d69632e636f6d2532466164646f6e73253246746f6e692d73756172657a25324675746d2d706172616d657465723f7374796c653d666c61742d737175617265266c6f676f3d73746174616d6963266c6f676f436f6c6f723d72676228323535253243253230333825324325323031353829266c6162656c3d53746174616d6963266c696e6b3d687474707325334125324625324673746174616d69632e636f6d2532466164646f6e73253246746f6e692d73756172657a25324675746d2d706172616d65746572)](https://statamic.com/addons/toni-suarez/utm-parameter)

A helper to store and handle UTM parameters session-based on statamic websites.

```
{{ if { utm:has type="source" value="google" } }}
    {{ utm:get type="medium" }}
{{ /if }}
```

---

Installation
------------

[](#installation)

You can search for this addon in the `Tools > Addons` section of the Statamic control panel and click **install**, or run the following command from your project root:

```
composer require suarez/statamic-utm-parameter
```

Optionally, you can publish the config file of this package with this command:

```
php artisan vendor:publish --tag="statamic-utm-parameter-config"
```

**Note**: The UTM parameters are stored **session-based**, meaning they are only available during the user's current browsing session and will be cleared when the user closes their browser or navigates away from your website. This addon leverages the [built-in Laravel session management](https://laravel.com/docs/session#configuration) system for storage.

Configuration
-------------

[](#configuration)

The configuration file `config/statamic-utm-parameter.php` allows you to control the behavior of the UTM parameters handling.

```
