All Collections
Data Connectors
Apple Search Ads - Getting Connected
Apple Search Ads - Getting Connected

How to setup the authentication to pull reporting data from Apple Search Ads API

Ed Campbell avatar
Written by Ed Campbell
Updated over a week ago

To pull reporting data from Apple Search Ads (ASA) we have to generate and share a series of access keys. This differs from a standard username / password or Oauth2 authentication and requires a few additional steps.

  1. Requested access to ASA for the email we will use for authenticating

    1. this would typically handled by the agency or client that owns the ASA account

    2. the account requires 'Api Key Manager' role

  2. Create a new Apple ID for the email address that has been granted

  3. Generate a Private Key to upload to Apple Search Ads

    1. {client-code} should be replace by the Bright Analytics client 'stub' code

      openssl ecparam -genkey -name prime256v1 -noout -out asa-{client-code}-key.pem

  4. Generate a Public Key for uploading to ASA

    1. {client-code} should be replace by the Bright Analytics client 'stub' code

      openssl ec -in asa-{client-code}-key.pem -pubout -out asa-{client-code}-public-key.pem

  5. Extract the Public Key and upload to ASA

  6. Securely store the Client Credentials generated by ASA

    1. clientId

    2. teamId

    3. keyId

  7. Create a connection in Bright Connect and define the following options

    1. apple_search_client_id (see above)

    2. apple_search_team_id (see above)

    3. apple_search_key_id (see above)

    4. apple_search_org_id : this is the ASA Account ID you wish to pull data

      1. if the account you wish to pull from is managed by an agency then the orgId may not be the one displayed the ASA UI

      2. to see which Accounts a user's access token has access to you should send a GET request, authenticated by the access token generated from the credentials above, to:

        https://api.searchads.apple.com/api/v4/acls

      3. the response to this API call will show the details of the accounts you have access to and should clarify which orgId to specify in the connection options.

    5. apple_search_private_key - key generated in step 3

      1. the entire private key should be base64 encoded before being added

        echo -n '{PRIVATE-KEY-GOES-HERE}' | base64

  8. Create the ASA import jobs in Bright Connect

    1. add relevant target tables

      1. specify the corresponding 'method' option per target table

  9. Associate the new ASA connection with the new ASA import job

  10. Test the job works.



Did this answer your question?