Download the PHP package neoseeker/url-campaignify without Composer

On this page you can find all versions of the php package neoseeker/url-campaignify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package url-campaignify

URL-Campaignify

Background

This is a tool to help add Google Analytics campaign tracking paramters to URLs and entire text blocks.

It was originally written by pixelistik to add campaign links for Piwik, an open source web analytics tool.

This fork has been modified to work only with Google Analytics and supports all of GA's campaign paramters for categorising incoming links. This tool works by appending additional GET params to your HTTP URLs:

http://my-site.tld/?utm_campaign=newsletter-5&utm_term=header-link&medium=email&utm_source=response

Read more about this on Google analytics.

What

This class aims to make it easier to dynamically append such parameters to URLs.

Single URLs

Instead of worrying about ? and & you can just do this:

$uc = new UrlCampaignify();

$url = "http://some-blog.tld/cms.php?post=123&layout=default";

$newUrl = $uc->campaignify($url, "newsletter-5", "header-link");

The result has properly appended parameters:

http://some-blog.tld/cms.php?post=123&layout=default&utm_campaign=newsletter-5&utm_term=header-link

Text blocks

You can also throw entire blobs of text at the function. It will find and campaignify all HTTP URLs in it.

$uc = new UrlCampaignify();

$text = "Look at http://my-site.tld especially".
        "here: http://my-site.tld/news.htm";

$newUrl = $uc->campaignify($text, "newsletter-5", "header-link");

If you are expecting HTML input, it makes sense to only change the URLs in href attributes. Use campaignifyHref() for this. It will turn

See <a href="http://site.tld">http://site.tld</a> for more information.

into

See <a href="http://site.tld?utm_campaign=foo">http://site.tld</a> for more information.

Have a look at the test cases to see which situations and edge cases have been covered -- or not.

Auto-number URLs in text blocks

All campaignified URLs in a text block are counted (starting at 1). You can use the current number of a URL in your keyword in sprintf() style. This is useful if you want to differentiate between several identical URLs in one text.

$uc = new UrlCampaignify();

$text = "Here comes the header link: http://my-site.tld".
        "here is a long and verbose text".
        "and another link at the end: http://my-site.tld";

$newUrl = $uc->campaignify($text, "news", "link-%d");

Will give you

Here comes the header link: http://my-site.tld?utm_campaign=news&utm_term=link-1
here is a long and verbose text and another link at the end:
http://my-site.tld?utm_campaign=news&utm_term=link-2";

Domains

It only makes sense to add campaigns if you actually analyse them. This implies that you control the site and its analytics tool. You can restrict UrlCampaignify to only work on URLs on a given Domain. Just pass it to the constructor

$uc = new UrlCampaignify('my-site.tld')

Note that subdomains are automatically included (this differ's from the original behaviour), so the above instance will touch URLs on www.my-site.tld.

You can disable this automatic behaviour by using

$uc->set_campaignify_subdomains(false);

You can specify multiple domains as an array:

$uc = new UrlCampaignify(array('my-site.tld', 'www.my-site.tld', 'my-other-site.tld'))

Major Differences Between This Fork and Original

  1. Uses only Google Analytics: utm_campaign, utm_source, utm_medium etc. utm_medium defaults to "email"
  2. Subdomains will be modified by default.
  3. The campaignify() and campaignifyHref() methods has been modified to accept Google Analytics parameters
  4. Campaignify will apply to URLs that do not have utm_medium set (the original code only applies campaignify if utm_campaign is not set)
  5. Campaignify will not replace utm values already present in URLs.

Installation

Using composer

URL-Campaignify matches the PSR-0 file layout and is on packagist. You should be able to simply type

composer require  neoseeker/url-campaignify:dev-master
composer install

to get the latest code from the master branch included into your project.

Just grabbing the file

You can also simply download the single file that provides the class: https://github.com/Neoseeker/url-campaignify/raw/master/src/Pixelistik/UrlCampaignify.php


All versions of url-campaignify with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package neoseeker/url-campaignify contains the following files

Loading the files please wait ....