Giter VIP home page Giter VIP logo

ams.connect's People

Contributors

danconte72 avatar danielindiano avatar vdias38 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

ams.connect's Issues

increase curl request timeout

when requesting rubicon for a large period it raises error due to timeout (see logs below), could we increae this timeout

2017-01-26T15:13:44.116605+00:00 app[web.1]: 10.141.27.204 - - [26/Jan/2017:15:13:14 +0000] "GET /rubicon?start=2016-12-21&end=2016-12-31 HTTP/1.1" 200 79 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36
2017-01-26T15:13:44.106375+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/rubicon?start=2016-12-21&end=2016-12-31" host=limitless-sea-32755.herokuapp.com request_id=bfb9fb9d-a87e-4639-b348-2e4cf87e2c3a fwd="186.205.3.207" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0

add logs to monitor behavior and exceptions

Precisa agora colocar logs, pode ser monolog mesmo, que é recomendado com o framework, as principais exception que precisamos loggar hoje são:
API response
errors
response time and size
Connection timeout
Mapping error, campo nao existe

Add Adserving Service

The Adserving report data will be received via attachments in mail box to be defined;

  • The service will call the Lib EmailReader to get the attachment with the data for a specific day;
  • Then this will append this new data to a file accessed by the AdServingTable Class;
    • For now we'll maintain this file in a project folder, but when it grow in size, we can migrate to a database like mongodb or firebase;
  • To prevent duplicated data to be appended, it will keep a PID Lock to check the last date of report data extracted;

Add AdSense mapping

Metrics and Dimensions

dimensions = [DATE, AD_UNIT_CODE]
metrics = [AD_REQUESTS, MATCHED_AD_REQUESTS, EARNINGS, AD_REQUESTS_RPM]

  • date = date
  • impr. reçues = AD_REQUESTS
  • impr. prises = MATCHED_AD_REQUESTS
  • revenu = EARNINGS*0.98
  • key = AD_UNIT_CODE
  • inventaire = "AdNetwork Fill"
  • cpm = AD_REQUESTS_RPM

GET https://www.googleapis.com/adsense/v1.4/accounts/pub-3651508233665711/reports?startDate=2017-01-29&endDate=2017-01-30&dimension=AD_UNIT_CODE&dimension=DATE&metric=EARNINGS&metric=MATCHED_AD_REQUESTS&metric=AD_REQUESTS_RPM&metric=AD_REQUESTS&key={YOUR_API_KEY}

Update impr. envoyées of rubicon when size_id = 2 or 10

For rubicon if size_id = {2, 15}, then check from AdServing if 'impr envoyé's is present, if not then impr. envoyées (ie. 2) = impr. reçues (57) - impr. prises (57) from same zone_id and size_id resp. 57, 10
The biggest format redirect to smallest

Allow to process Adserving monthly reports

In order to compute reports of providers for last month, we need to save on AMS.connect the Adserving of last month. To achieve it I suggest to allow processing a monthly reports sent by email. The admin could sent the latest report (no matter if it's not the latest month) to amsconnect+latest@... and if we call /adserving?email=amsconnect+latest@... it will process it.

Add adTech Provider

Documentation: http://www.adtech-demo.com/API (also reachable on https://adtech.fluidtopics.net/search#!search;query=api)

API Access:

Adapting the configuration for SSO

  1. Ensure that ADTECH has enabled your ONE BY AOL: AdServer UI login to be SSO
    compatible
  2. Replace {USERNAME} with your SSO user name
  3. Replace {PASSWORD} with your SSO password
  4. Replace {SERVER_URL} with your location’s server URL.
  5. Replace {LOGIN_SERVER_URL} with your location’s login server URL.
  6. You are now ready to run the SSO code.

allow to select period w/ start and end dates params

permitir selecionar um período com params Dates (Y-m-d) "start" e "end" (correspondem aos labels usados no sitebuilder para items.type==promotions), recomendo usar os mesmos para ser consistente. No caso do sublime, que não permite selecionar período, usar o valor "start" como filtro e ignorar "end".

add fillRate

Add following field
fillRate = "impressions reçues" / "impressions prises" * 100 + '%'

Add new fields from static AdServing file

AdServing is a static file updated by cron on AMS.Connect and using following format:

Impressions envoyées,	Date,	Key
5177,	1/23/2017,	394466-67
5687,	1/23/2017,	394466-43
26115,	1/23/2017,	395228-10

Be careful the date use format MMDDYYYY

Both fields added on AMS.Format are described below:

impressions envoyées = $line["Imps. sans défaut"]
discrepencies = (1 -$line["Imps. sans défaut"]/$array["impressions reçues"] )*100 + '%'

missing rows on rubicon report

When we request monthly datas (from 01-02 to 28-02 for example) of rubicon, a lot of rows are missing. For instance 392430-57 is missing for 02-02

randomly request raises Error 'failed to open stream'

seems first request after long time idle. See logs below. The request was https://limitless-sea-32755.herokuapp.com/adsense, but I've observed it also for rubicon:

in AMSPresenter.php line 26
at Application->Laravel\Lumen\Concerns\{closure}(2, 'fopen(csvOutput1485961973.csv): failed to open stream: No such file or directory', '/app/app/Services/AMSPresenter.php', 26, array('file' => 'csvOutput1485961973.csv'))
at fopen('csvOutput1485961973.csv', 'r') in AMSPresenter.php line 26
at AMSPresenter->echoCsv('csvOutput1485961973.csv') in AdsensePresenter.php line 61
at AdsensePresenter->present(array(array('AD_UNIT_CODE' => '1022077801', 'DATE' => '2017-01-31', 'AD_REQUESTS' => '117', 

https___limitless-sea-32755_herokuapp_com_adsense

update mapping of sublime Service

  • date: provided by AMS.Connect if unique day
  • impr. reçues: "NA"
  • impr. prises: impr
  • revenue: rev
  • key: zone
  • inventaire: "AMS Market Place"
  • ecpm: (revenue/impr prises) * 1000
  • annonceur: "sublime"

by default select last day report

  • criteo: por dia Y-m-d, com start e end dates
  • rubicon: por datetime Y-m-dTHⓂ️s, com start e end datetimes. Então o dia corresponde ao intervalo Y-m-d 00:00:00 - Y-m-d 23:59:59
  • sublime: por dia, sem permitir selecionar períodos, somente um dia de cada vez

Allow to process Premium monthly reports

In order to compute premium reports for larger period then one day, I suggest to allow processing monthly reports sent by email. The admin could sent the latest report (no matter if it's not the latest month) to amsconnect+latest@... and if we call /adtech?email=amsconnect+latest@... it will process it.

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.