Wrong CPM and revenue value Google AdManager Report API - python-3.x

I am trying to pull report from google ad manager using API
report_job = {
'reportQuery': {
'dimensions': ['AD_EXCHANGE_DATE', 'AD_EXCHANGE_COUNTRY_NAME'],
'columns': ['AD_EXCHANGE_AD_REQUESTS', 'AD_EXCHANGE_IMPRESSIONS',
'AD_EXCHANGE_ESTIMATED_REVENUE','AD_EXCHANGE_AD_ECPM'],
'dateRangeType': 'LAST_WEEK',
'timeZoneType': 'AD_EXCHANGE', # Run in pacific time
'adxReportCurrency': 'USD'
}
}
I suspect the downloaded report has very wired ECPM and Revenue values. as below
Please help if i am doing something wrong, as the ECPM has to be very low and the revenue as well.

"Money values are always specified in terms of micros which are a millionth of the fundamental currency unit. For US dollars, $1 is 1,000,000 micros."
From the AdManager API official documentation here: https://developers.google.com/ad-manager/api/reference/v202008/LineItemService.Money#microAmount

Related

flight offer search not pulling all air fares

I would like to seek help on the codes below.
Apparently, the code works by pulling out air fares but it seems like it does not pull out all the available air fares that I can see directly from the airlines websites.
Could anyone please assist me to let me know what's happening? Thanks!
from amadeus import Client, ResponseError
Origin = "SIN"
Destination = "CDG"
amadeus = Client(hostname='production', client_id='HIDDEN', client_secret='HIDDEN')
try:
'''
Find the cheapest flights from Origin to Destination
'''
response = amadeus.shopping.flight_offers_search.get(
#originLocationCode=Origin, destinationLocationCode=Destination, departureDate='2023-04-04', adults=1)
originLocationCode=Origin, destinationLocationCode=Destination, departureDate='2023-03-03', returnDate='2023-04-04', travelClass='BUSINESS', includedAirlineCodes='SQ', currencyCode='SGD', adults=1)
print(response.data)
except ResponseError as error:
raise error
The Self-Service APIs only return public fares coming from the GDS. That means that you will find discrepancy for both the flights and the prices too comparing to some websites you might visit.
For more details check the section carriers and rates in the developer guides.

Google Ads API - How to get all campaigns that are created via google ads api (Node JS)

I am trying to find the total cost of google ads campaigns that are created via a particular manager account or via google ads api.
I tried the change event query where it gives me all the campaigns created via google ads but the issue is with change_event.change_date_time. It requires this filter otherwise it throws an error. Because of this filter, I am only getting campaigns that are created in this specific time period, but I need all campaigns.
SELECT
change_event.campaign
FROM change_event
WHERE
campaign.status != 'REMOVED'
AND change_event.change_date_time >= '${from_date}'
AND change_event.change_date_time <= '${to_date}'
AND change_event.client_type = 'GOOGLE_ADS_API'
ORDER BY change_event.change_date_time ASC
LIMIT 10000
Reference Link: https://developers.google.com/google-ads/api/fields/v9/change_event_query_builder
Unfortunately, change_event can only go retrieve data up to 30 days old (see here).
I've tried building a query that could get that information but using FROM campaign but it seems like only change_event has access to how a campaign was created.
A possible solution would be to create multiple from/to date on 30-day cycles, starting from the account creation date.
Otherwise, you can use change status for a slightly larger window of 90 days, with the limitation that you can't filter by change_event.client_type = 'GOOGLE_ADS_API', using simply change_status.resource_status = 'ADDED' instead.
SELECT
change_status.campaign
FROM change_status
WHERE
campaign.status != 'REMOVED'
AND change_status.resource_status = 'ADDED'
AND change_status.last_change_date_time >= '${from_date}'
AND change_status.last_change_date_time <= '${to_date}'
ORDER BY change_status.last_change_date_time ASC
LIMIT 10000

PowerBI MicrosoftAzureConsumptionInsights - changing query to get more than 2 months

I am using PowerBI to analyze Cost data from Azure. I am making a direct connection and pulling in data by: opening PowerBI | Get Data | Online Services | Microsoft Azure Consumption Insights (Beta) This works, however, I am only able to see two months of data and ideally I'd like to see 6. After a lot of searching the general consensus from other users seems to be using the advanced editor to tweak the query by adding "optionalParameters" and specifying the number of months... I came across a few other sites where users were experiencing the same issue but the suggestions didn't work. I am hoping someone here can point me in the right direction.
I'm going to post the query string and below that list out the URLs containing suggestions I've already tried.
let
enrollmentNumber = "xxxxxxx",
optionalParameters = [ numberOfMonth = 6, dataType="DetailCharges" ],
Source = MicrosoftAzureConsumptionInsights.Tables(enrollmentNumber, optionalParameters),
usagedetails = Source{[Key="usagedetails"]}[Data],
#"Parsed JSON" = Table.TransformColumns(usagedetails,{{"Tags", Json.Document}}),
#"Expanded Tags" = Table.ExpandRecordColumn(#"Parsed JSON", "Tags", {"environment", "application", "costCenter", "owner"}, {"Tags.environment", "Tags.application", "Tags.costCenter", "Tags.owner"})
in
#"Expanded Tags"
https://community.powerbi.com/t5/Desktop/Azure-consumption-insights-get-more-than-two-month-usage-details/td-p/541413
https://community.powerbi.com/t5/Desktop/Power-BI-desktop-and-getting-multiple-months-in-one-row-from-the/td-p/50585
https://community.powerbi.com/t5/Desktop/Extend-the-Azure-consupmtion-data/td-p/444508
https://learn.microsoft.com/en-us/power-bi/desktop-connect-azure-consumption-insights
I opened a case and now have a solution to this problem.
First - The version of PowerBI had to be upgraded to the latest version. The version I upgraded to is: Version: 2.75.5649.961 64-bit (November 2019)
Second - Microsoft Azure Consumption Insights is being phased out and is being replaced by Azure Cost Management. This won't work with Consumption insights.
I was able to increase the number of months by:
Get Data | Azure | Azure Cost Management
Fill in the required information specifying number of months.
Get Data Dialog

Google maps directions from A to B considering traffic

Is there any way to get google maps directions from A to B with considering traffic at the moment of calling the function?
This code below works fine if it is empty road:
var gm = require("googlemaps");
gm.directions("from", "where go to" , function ( err, data ) {
console.log(data.routes[0].legs[0].distance);
console.log(data.routes[0].legs[0].duration);
}, "false");
I am new to google maps, so please any thought to spare?
A quick look at the documentation gives you a clear answer:
durationInTraffic (optional) specifies whether the DirectionsLeg result should include a duration that takes into account current traffic conditions. This feature is only available for Maps for Business customers. The time in current traffic will only be returned if traffic information is available in the requested area.

Using a postcode range for shipping (expresso-store)

We're building a online-store/site for a winery, and they have a matrix/table of shipping costs to different regions (in Australia).
In Exp-resso Store 1.6.0, is there anyway of setting up a post-code for a specific shipping cost?
i.e. postcode= 2000-2249, 2555-2574 = $10 + $1/kg. 1250-1263 = $12 +$1.1/kg
Additional info: The deliveries are technically through AusPost, but using their "Wine Delivery Service" which doesn't match their normal parcel delivery stuff, so we can't use the AusPost plugin/API :(
There's no way to do this from the control panel. However, you can easily write your own shipping calculator using PHP.
An example of a simple custom shipping plugin is here:
https://gist.github.com/2176462

Resources