2017 © Pedro Peláez
 

library swiftmailer-google-campaign

Append to all email links google campaign parameters

image

openbuildings/swiftmailer-google-campaign

Append to all email links google campaign parameters

  • Wednesday, August 2, 2017
  • by yanev
  • Repository
  • 12 Watchers
  • 4 Stars
  • 42,652 Installations
  • PHP
  • 1 Dependents
  • 2 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 11 % Grown

The README.md

Swiftmailer GoogleCampaign Plugin

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version, (*1)

A swiftmailer plugin that appends automatically to all email links google campaign parameters from a config file or a custom one to the links you want, (*2)

Usage

$mailer = Swift_Mailer::newInstance();

$mailer->registerPLugin(new GoogleCampaignPlugin([
   'utm_source' => 'source',
   'utm_campaign' => 'email',
   'utm_medium' => 'email'
]);

Before sending email the plugin will append to all links the campaign parameters:, (*3)

<html>
    <body>
     <a href="http://example.com">Example.com</a>
    </body>
</html>

Will be converted to, (*4)

<html>
    <body>
     <a href="http://example.com?utm_source=source&amp;utm_campaign=email&amp;utm_medium=email">Example.com</a>
    </body>
</html>

The plugin supports also embeding additional campaigns to your email:, (*5)

$mailer = Swift_Mailer::newInstance();

$mailer->registerPLugin(
    new GoogleCampaignPlugin(
        [
           'utm_source' => 'source',
           'utm_campaign' => 'email',
           'utm_medium' => 'email'
        ],
        [
            'your_campaign' => [
               'utm_source' => 'my_custom_source',
               'utm_campaign' => 'my_custom_campaign'
            ]
        ]
    )
);

To embed a custom campaign to your email simply add the google_campaign query parameter to your link with value - the name of your campaign:, (*6)

<html>
    <body>
     <a href="http://example.com?google_campaign=your_campaign">Example.com</a>
    </body>
</html>

Will output:, (*7)

<html>
    <body>
     <a href="http://example.com?utm_source=my_custom_source&amp;utm_campaign=my_custom_campaign">Example.com</a>
    </body>
</html>

License

Copyright (c) 2013, OpenBuildings Ltd. Developed by Yasen Yanev as part of clippings.com, (*8)

Under BSD-3-Clause license, read LICENSE file., (*9)

The Versions

02/08 2017

dev-master

9999999-dev

Append to all email links google campaign parameters

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Yasen Yanev

23/10 2015

0.2.0

0.2.0.0

Append to all email links google campaign parameters

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Yasen Yanev

01/10 2013

0.1.3

0.1.3.0

Append to all email links google campaign parameters

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Yasen Yanev

01/10 2013

0.1.2

0.1.2.0

Append to all email links google campaign parameters

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Yasen Yanev

01/10 2013

0.1.1

0.1.1.0

Append to all email links google campaign parameters

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Yasen Yanev

27/09 2013

0.1.0

0.1.0.0

Append to all email links google campaign parameters

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.2

 

The Development Requires

by Yasen Yanev