Giter VIP home page Giter VIP logo

adfox's Introduction

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);

adfox's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

unquaiz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.