Hi, I'm using the following link to retrieve google ads data for reporting.

My 
yaml: https://github.com/googleads/google-ads-python/blob/master/google-ads.yaml
My 
code: 
https://github.com/googleads/google-ads-python/blob/master/examples/reporting/get_campaign_stats_to_csv.py

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

Getting this error after running the file:
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.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/114326f2-bdad-43a5-b92a-6b7b927e347bn%40googlegroups.com.

Reply via email to