I am trying to setup a webhook in AWS Lambda (using API Gateway) for Meta's WhatsApp Business API. They have the following guidelines:

Whenever your endpoint receives a verification request, it must:

Verify that the hub.verify_token value matches the string you set in the Verify Token field when you configure Webhooks in your App Dashboard (you haven't set up this token string yet). Respond with the hub.challenge value."

I have setup all the query strings it needs in the API gateway. Here is what my lambda handler looks like:

def lambda_handler(event, context):     response = {         "status": 400,         "body" : "failed"     }          print(str(event))          print("Received context" + str(context))          if(len(event) != 0 and (event['hub.verify_token'] == "some value")):         response['status'] = 200         response['body'] = event['hub.challenge']         return event['hub.challenge']               #print(response)         #returnResponse = re.findall('[0-9]+', event['hub.challenge'])         #return returnResponse[0]              else:         return(response) 

the event looks like:

{     "hub.mode" : "some value",     "hub.verify_token": "some value",     "hub.challenge": "1158201444" } 

The response in AWS console looks like "1158201444" but on meta's end, the response looks like "\"1158201444\"" and the webhook confirmation fails in Meta's dashboard.

How can remove the extra characters and decode the string? I have already tried regex and still getting the extra characters (\"\").

I am trying to build a report that shows metrics such as clicks, impressions and costs per targeted location from Google Ads.

I compare these numbers with Campaigns stats and it does not match. I got lower number from Geo stats actually. On the other hand, in google Ads application, the numbers are the same.

(When I compare Ads stats with Campaing stats, it is matching for 100 %)

Would you know how what I am doing wrong? How the query from geo stats should look to match with Campaign stats?

Thanks for help.

select sum(Clicks) FROM `ct-gtm.Google_Ads_Manager_Account.CampaignBasicStats` as stats where stats.Date between '2022-10-01' and '2022-10-31' select sum(Clicks) from `ct-gtm.Google_Ads_Manager_Account.GeoStats_3749539878` as stats where stats.Date between '2022-10-01' and '2022-10-31' and IsTargetingLocation = true I would expect the same numbers but geo stats result is smaller. 

I'm trying to use selenium to download reports from Google Ads, the script is working fine until I try to click the Campaign-wide target button in the image, It's not showing in the DOM and selenium can't see it until I click/inspect it that it's accessible.

I tried to switch frames and search for it but to no avail, I have only two frames when I try

iframes = b.driver.find_elements(By.XPATH, "//iframe")

Code:

from selenium import webdriver from selenium.webdriver.chrome.service import Service as ChromeService from webdriver_manager.chrome import ChromeDriverManager from time import sleep from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC import csv class Bot:     def __init__(self, user_data_dir=None, profile_dir=None, csv_filename=None):         self.__service = ChromeService(ChromeDriverManager().install())         self.user_data_dir = user_data_dir          self.profile_dir = profile_dir         self.__options = webdriver.ChromeOptions()         self.__options.add_argument(f"user-data-dir={self.user_data_dir}")         self.__options.add_argument(f"--profile-directory={self.profile_dir}")         self.csv_filename = csv_filename or "data.csv"         self.driver = webdriver.Chrome(service=self.__service, options=self.__options)       def login(self):         self.driver.get("https://ads.google.com")         sleep(1)         try:             # get the sign in button and click it             sign_in_btn = self.driver.find_element(By.XPATH, '//*[@id="header-topbar"]/div/div[3]/div/div[3]/a')             sign_in_btn.click()             sleep(2)                      except Exception as e:             print(e)             # if the sign in button is not found, try clicking the drawer menu button and then the sign in button             drawer_btn = self.driver.find_element(By.XPATH, '//*[@id="header-drawer"]/div/div/div/div[1]/div/button')             drawer_btn.click()             sleep(2)                          sign_in_btn = self.driver.find_element(By.XPATH, '//*[@id="header-topbar"]/div/div[3]/div/div[3]/a')             sign_in_btn.click()             sleep(2)         finally:             accnt_btn = self.driver.find_element(By.XPATH, '/html/body/div[1]/root/div[2]/nav-view-loader/multiaccount-view/div/div[2]/div/div[1]/material-list/material-list-item[4]/div/div[1]')             accnt_btn.click()             sleep(5)          def do(self):         self.login()         # get the campaigns button dropdown button and click it         campaigns_drpdwn_btn = self.driver.find_element(By.XPATH, '/html/body/div[2]/root/div/div[1]/div/div/div[3]/div/div/awsm-skinny-nav/nav/div[1]/div[3]/awsm-skinny-nav-item[1]/a/material-ripple')         campaigns_drpdwn_btn.click()         sleep(2)         # TODO get all the campaigs lists and click on each one of them         # get a certain campaign and click it         campaign_btn = self.driver.find_element(By.XPATH, '//*[@id="cmExtensionPoint-id"]/base-root/div/div[2]/div[1]/view-loader/campaign-view/tableview/div[6]/ess-table/ess-particle-table/div[1]/div/div[2]/div[3]/ess-cell[2]/campaign-name/campaign-name-generic/a')         campaign_btn.click()         sleep(2)         # campaign more details button         campaign_more_details_btn = self.driver.find_element(By.XPATH, '/html/body/div[2]/root/div/div[1]/div/div/div[3]/div/content-header/deferred-infosnack/infosnack/div/div[1]/review-panel-trigger/button/div[2]')         campaign_more_details_btn.click()         sleep(5)         # get the bid strategy button, using the 'Maximize conversions' text as a span and click it         campaign_bid_strategy_btn = self.driver.find_element(By.XPATH, "//span[contains(text(), 'Maximize conversions')]")         campaign_bid_strategy_btn.click()         sleep(4)         # get the campaign simulator button and click it         campaign_sim_btn = self.driver.find_element(By.XPATH, "//span[contains(text(), 'Campaign simulator')]")         campaign_sim_btn.click()         sleep(2)         # get the campaign simulator target dropdown and click it [%, campaign wide target]         campaign_sim_target_dropdn = self.driver.find_element(By.XPATH, "//span[contains(text(), 'Target scaling')]")         campaign_sim_target_dropdn.click()         sleep(2)         campaign_wide_target_btn = self.driver.find_element(By.XPATH, "//span[contains(text(), 'Campaign-wide target')]")         campaign_wide_target_btn.click()         sleep(2) 

I'm trying to get selenium to see the button, any help would be appreciated.

The Image shows the overview of ads related to an ad account, I need to find the cost marked in the pic through API

I tried with

 ad_group metrics.average_cost, metrics.cost,      account_budget.amount_served_micros,      account_budget.total_adjustments_micros,      account_budget.proposed_spending_limit_micros,     account_budget_proposal.account_budget,     account_budget_proposal.approved_spending_limit_micros,      account_budget_proposal.proposed_spending_limit_micros,      campaign.campaign_budget,      campaign_budget.amount_micros,      campaign_budget.total_amount_micros 

most of the values I got in these are zero or not relevant to the cost in the overview (marked in pic) . Can someone help me find the cost value( which is marked in the image) in the ads overview screen through GoogleAds API.