Hi, I'm using the following link to retrieve google ads data for reporting.
Can someone please tell me if I'm going in the right direction. Also, please tell me how to fill the code here. How to fill the arguments in the parser?
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
google_ads_client = GoogleAdsClient.load_from_storage('C:/Users/Hp/Desktop/google analytics data extraction/googleads.yaml')
parser = argparse.ArgumentParser(
description="Retrieves a campaign stats and writes to CSV file."
)
# The following argument(s) should be provided to run the example.
parser.add_argument(
"-c",
"-abc-def-ghi",
type=str,
required=True,
help="The Google Ads customer ID of the account you would like to get "
"the report for to write to CSV.",
)
parser.add_argument(
"-o",
"-ads.txt",
type=str,
required=True,
help="Name of the local CSV file to save the report to. File will be "
"saved in the same directory as the script.",
)
# Optional boolean argument for writing headers.
parser.add_argument(
"-w",
"--write_headers",
action="store_true",
help="Writes headers to the CSV file if argument is supplied. Simply "
"add -w if you want the headers defined in the script to be "
"added as the first row in the CSV file.",
)
args = parser.parse_args()
main(
google_ads_client,
args.customer_id,
args.output_file,
args.write_headers,
)
usage: untitled1.py [-h] -c C -o O [-w]
untitled1.py: error: the following arguments are required: -c/-abc-def-ghij, -o/-ads.txt
An exception has occurred, use %tb to see the full traceback.