2017 © Pedro Peláez
 

library adfox

AdFox API Lib

image

vleukhin/adfox

AdFox API Lib

  • Tuesday, July 19, 2016
  • by vleukhin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Library to interact with AdFox advertisment system

Supported Features

  • Create flight/campaign
  • Placing flights on place or site
  • Set impressions/clicks/events restrictions
  • Change flight/campaign status and level
  • Create/Editing banners
  • Targeting (user, time, frequency)

Examples

Create and edit campaign

$adfox = new Adfox\Adfox('login', 'pass');

$campaign = $adfox->createCampaign('Test campaign');
$campaign->setLevel(3);
$campaign->setStatus(\AdFox\AdFox::OBJECT_STATUS_PAUSED);
$campaign->setImpressionsLimits(5000, 1000, 100);
$campaign->save();

$campaign->getMaxImpressions(); // 5000
$campaign->getMaxImpressionsPerDay(); // 1000
$campaign->getMaxImpressionsPerHour(); // 100

$campaign->isActive() // false

Create and edit flight

$adfox = new Adfox\Adfox('login', 'pass');

$campaign = $adfox->createCampaign('Test campaign', 'advertiserId');
$flight = $campaign->createFilght();

$flight->isActive() // true
$flight->setStatus(\AdFox\AdFox::OBJECT_STATUS_PAUSED)->save();
$flight->isActive() // false
$flight->isPaused() // true

$flight->setClicksLimits(5000, 1000)->save();
$flight->getMaxClicksPerDay(); // 1000
$flight->getMaxClicksPerHour(); // 0, no limit

Create and edit banners

$adfox = new Adfox\Adfox('login', 'pass');

$campaign = $adfox->createCampaign('Test campaign', 'advertiserId');
$flight = $campaign->createFilght();

$template = $adfox->findBannerTypeByName('BackGround')->findTemplate('BackGround WShifter');

$banner = \AdFox\Campaigns\Banner\Banner::make($adfox, 'New brand banner!', $template, [
    'trackingURL' => '//banners.adfox.ru/transparent.gif',
    'reference' => 'http://php.net',
    'user1' => '#fff',
])->setClicksLimits(10000)->setImpressionsLimits(500000);

$banner->addToFlight($flight);
// or
$flight->addBanner($banner);
$banner = $adfox->findBanner(1724257)->setParam('user5', '55%')->save();

Placing flights on place or site

$adfox = new Adfox\Adfox('login', 'pass');

$flight = $adfox->findFlight(123);
$site = $adfox->findSiteByName('kakprosto.ru');
$place = $site->findPlaceByName('Брендирование (асинх.)');

$flight->placeOnPlace($place);
$flight->removeFromPlace($place);

$flight->placeOnSite($site);
$flight->removeFromPlace($site);

Setting targeting

$adfox = new Adfox\Adfox('login', 'pass');

$flight = $adfox->findFlight(123);
$targeting = new \AdFox\Campaign\Targeting\TargetingTime();
// Set impressions limits to 100 on mondays
$targeting->setImpressions(100, \AdFox\Campaign\Targeting\TargetingTime::DAY_MONDAY);

$flight->applyTargeting($targeting);

$targeting = new \AdFox\Campaign\Targeting\TargetingUser($adfox, 1 /* puid1 */);
$targeting->disableAll();
$targeting->enable(3); // enable option with key=3

$flight->applyTargeting($targeting);

$targeting = new \AdFox\Campaign\Targeting\TargetingFrequency();
$targeting->setmaxUniqueImpressions(10);
$targeting->setmaxUniqueClicks(2);
$targeting->setClicksFrequency(\AdFox\Campaign\Targeting\TargetingFrequency::FREQUENCY_DAY, 3);

$flight->applyTargeting($targeting);

The Versions

19/07 2016

dev-develop

dev-develop

AdFox API Lib

  Sources   Download

proprietary

The Requires

  • php >=5.4
  • lib-curl *
  • lib-openssl *

 

by Viktor Leukhin

adfox advertisment

19/07 2016

dev-master

9999999-dev

AdFox API Lib

  Sources   Download

proprietary

The Requires

  • php >=5.4
  • lib-curl *
  • lib-openssl *

 

by Viktor Leukhin

adfox advertisment

19/07 2016

v0.5.2

0.5.2.0

AdFox API Lib

  Sources   Download

proprietary

The Requires

  • php >=5.4
  • lib-curl *
  • lib-openssl *

 

by Viktor Leukhin

adfox advertisment

18/07 2016

v0.5.1

0.5.1.0

AdFox API Lib

  Sources   Download

proprietary

The Requires

  • php >=5.4
  • lib-curl *
  • lib-openssl *

 

by Viktor Leukhin

adfox advertisment

15/07 2016

v0.5.0

0.5.0.0

AdFox API Lib

  Sources   Download

proprietary

The Requires

  • php >=5.4
  • lib-curl *
  • lib-openssl *

 

by Viktor Leukhin

adfox advertisment

12/07 2016

v0.4.0

0.4.0.0

AdFox API Lib

  Sources   Download

proprietary

The Requires

  • php >=5.4
  • lib-curl *
  • lib-openssl *

 

by Viktor Leukhin

adfox advertisment

07/07 2016

v0.3.2

0.3.2.0

AdFox API Lib

  Sources   Download

proprietary

The Requires

  • php >=5.4

 

by Viktor Leukhin

adfox advertisment

07/07 2016

v0.3.1

0.3.1.0

AdFox API Lib

  Sources   Download

proprietary

The Requires

  • php >=5.4

 

by Viktor Leukhin

adfox advertisment

05/07 2016

v0.3.0

0.3.0.0

AdFox API Lib

  Sources   Download

proprietary

by Viktor Leukhin

05/07 2016

v0.2.0

0.2.0.0

AdFox API Lib

  Sources   Download

proprietary

by Viktor Leukhin

04/07 2016

v0.1.0

0.1.0.0

AdFox API Lib

  Sources   Download

proprietary

by Viktor Leukhin