7span / laravel-google-utm by hemratna

Adding Google UTM parameters to URL.
1,213
1
2
Package Data
Maintainer Username: hemratna
Maintainer Contact: hemratna.bhimani@gmail.com (hemratna)
Package Create Date: 2016-09-14
Package Last Update: 2016-09-14
Language: PHP
License: The MIT License (MIT)
Last Refreshed: 2025-02-05 03:13:15
Package Statistics
Total Downloads: 1,213
Monthly Downloads: 28
Daily Downloads: 3
Total Stars: 1
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Add Google UTM parameters with ease

This package will add Google UTM parameters to any Laravel URL. This package will also help to add "ref" query string parameter to URL.

In Your View

<html>
<head></head>
<body>

    <!-- Generate like http://www.site.com/dashboard?ref=logo -->
	{!! GUTM::add( url('/dashboard'),   'logo'  ) !!}
	
	<!-- Generate like http://www.site.com/dashboard?utm_source=github&utm_medium=readme&utm_term=googleUTM&utm_content=ads&utm_campaign=githubRepo -->
	{!! GUTM::add( url('/dashboard'),  [ 'github' , 'readme' , 'googleUTM' , 'ads' , 'githubRepo' ] ) !!}

</body>
</html>

Install

First add the package to your composer:

{
    "require": {
       "sevenspan/laravel-google-utm": "dev-master"
    }
}

You must install a facade, which provides an easy way to call the the class.

// config/app.php
'aliases' => [
    ...
    'GUTM'      => Sevenspan\LaravelGoogleUTM\LaravelGoogleUTM::class,
    ...
];

License

The MIT License (MIT). Please see License File for more information.