/utm-url-parser

UTM URL String Parser

Primary LanguagePHPMIT LicenseMIT

UTM URL String Parser

Build Status

Install

Via Composer

$ composer require rhincodon/utm-url-parser

Usage

    $utmUrl = 'http://test.com/test?utm_source=bing&&utm_medium=cpc&utm_campaign=rolex&utm_term=rolex+two';
    $parser = new \Rhinodontypicus\Parsers\UtmParser();
    $utmString = $parser->parse($utmUrl);
    if ($utmString->isValid()) { // true
        echo $utmString->source; // bing
        echo $utmString->medium; // cpc
        echo $utmString->campaign; // rolex
        echo $utmString->term; // rolex two
    }

Credits

License

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