Untuk mendiskusikan dan memberikan masukan tentang produk kami, bergabunglah ke channel Discord Google Ads resmi di server Komunitas Iklan dan Pengukuran Google.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Pada langkah ini, Anda mengidentifikasi akun Google Ads untuk membuat panggilan API. Akun dapat berupa akun produksi (aktif) atau akun pengujian. Setiap pendekatan memiliki
kelebihan dan kekurangan.
Akun produksi
Akun pengujian
Kelebihan
Lebih mudah menulis dan menguji kode yang berfungsi terhadap konten akun tertentu.
Lebih mudah menulis dan menguji kode yang memproses data pelaporan langsung.
Akun pengujian tidak menayangkan iklan, sehingga bug pemrograman
tidak akan memengaruhi kampanye aktif Anda.
Berfungsi dengan token developer yang memiliki tingkat Akses Pengujian.
Kekurangan
Bug pemrograman dalam fase pengembangan dapat memengaruhi penayangan kampanye aktif, sehingga menyebabkan masalah seperti performa kampanye yang buruk, penayangan yang salah, atau kerugian finansial.
Token developer harus memiliki setidaknya tingkat Akses Dasar untuk
agar dapat melakukan panggilan API.
Anda harus merekonstruksi kampanye dalam akun pengujian untuk menguji kode
yang berfungsi terhadap konten akun tertentu.
Karena akun pengujian tidak menayangkan iklan, fitur yang terkait dengan penayangan langsung
seperti statistik pelaporan, error pelanggaran kebijakan, atau pemrosesan impor
konversi offline tidak didukung, sehingga sulit untuk menguji fitur
tersebut.
Sebaiknya gunakan akun pengujian saat mengembangkan aplikasi jika memungkinkan. Untuk mengetahui petunjuknya, lihat Membuat akun dan kampanye pengujian.
Alternatifnya adalah menyiapkan akun produksi dengan anggaran akun yang rendah,
seperti Rp10.000/hari, secara eksplisit untuk menguji fitur yang tidak didukung oleh
akun pengujian.
Pilihan set fitur
Saat memilih akun untuk melakukan panggilan API, pertimbangan tambahan adalah daftar fitur yang ingin Anda gunakan dengan API. Meskipun Anda memilih untuk menggunakan akun produksi, ada beberapa fitur yang spesifik per akun, misalnya:
Untuk fitur penagihan, Anda memerlukan akun yang menggunakan invoice bulanan.
Beberapa fitur baru di akun mungkin dibatasi oleh daftar yang diizinkan.
Sebelum menyelesaikan akun untuk melakukan panggilan API, periksa
dokumentasi fitur tertentu untuk memastikan bahwa fitur tersebut tidak
memiliki batasan tambahan.
Mengidentifikasi ID pelanggan login dan ID pelanggan
Untuk melakukan panggilan API ke pelanggan Google Ads, Anda harus memberikan akses dan izin yang sesuai ke akun layanan Anda untuk akun pelanggan baik secara langsung maupun melalui akun pengelola tertaut. Untuk melakukannya, Anda memerlukan akses administrator ke akun pelanggan.
Mulai dengan login ke akun Google Ads Anda sebagai administrator. Dalam beberapa kasus,
Anda mungkin memiliki lebih dari satu akun pelanggan untuk dipilih. Akun yang Anda pilih akan menetapkan ID pelanggan login, yang merupakan header wajib untuk beberapa panggilan API.
Setelah Anda mengidentifikasi pelanggan Google Ads yang akan dipanggil API-nya, catat detail berikut:
ID pelanggan 10 digit dari akun pelanggan yang akan Anda gunakan untuk membuat
panggilan API. Hal ini terkadang disebut sebagai pelanggan yang beroperasi.
ID pelanggan login 10 digit dari akun pelanggan yang Anda gunakan untuk login.
Jika Anda login ke pelanggan operasi, ID pelanggan login sama dengan ID pelanggan. Jika Anda login ke akun pengelola pelanggan yang beroperasi, ID pelanggan login adalah ID pelanggan akun pengelola.
Memberikan akses ke akun layanan
Saat login ke akun Google Ads sebagai administrator, buka
Admin > Akses dan keamanan.
Klik tombol + di tab Pengguna.
Ketik alamat email akun layanan ke dalam kotak input Email. Pilih tingkat akses akun yang sesuai, lalu klik tombol Tambahkan akun. Perhatikan bahwa tingkat akses Email tidak didukung untuk akun layanan.
Akun layanan diberi akses.
Secara default, Anda tidak dapat memberikan akses administrator ke akun layanan. Jika panggilan API Anda memerlukan akses administrator, Anda dapat mengupgrade akses sebagai berikut.
Klik panah drop-down di samping tingkat akses akun layanan
di kolom Tingkat akses.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-05 UTC."],[[["\u003cp\u003eChoose a Google Ads account (production or test) to make API calls, noting its email address for generating OAuth 2.0 refresh tokens.\u003c/p\u003e\n"],["\u003cp\u003eTest accounts are recommended for development to prevent affecting live campaigns; however, they don't support features related to live serving.\u003c/p\u003e\n"],["\u003cp\u003eProduction accounts, with a low budget, can be used to test features unsupported by test accounts, but a programming bug can affect live campaigns.\u003c/p\u003e\n"],["\u003cp\u003eEnsure the selected account supports the desired features as some features have account-specific restrictions.\u003c/p\u003e\n"],["\u003cp\u003eTo make API calls, you need access to the customer account, the 10-digit customer ID, email address for OAuth 2.0 token generation, and the 10-digit login customer ID.\u003c/p\u003e\n"]]],[],null,["# Prepare the customer account\n\n**Note:** The current step of this tutorial depends on the [type of application](/google-ads/api/docs/get-started/choose-application-type) you are building. We strongly recommend using service account to make API calls. However, the user authentication option is also provided as an alternative. The rest of this tutorial will be customized based on your choice. \nService accounts User authentication\n\nIn this step, you identify a Google Ads account to make API calls to. The account\ncan either be a production (live) account or a test account. Each approach has\nits advantages and disadvantages.\n\n|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | ##### Production accounts | ##### Test accounts |\n| ##### Advantages | - Easier to write and test code that works against specific account contents. - Easier to write and test code that processes live reporting data. | - Test accounts *don't* serve ads, hence programming bugs won't affect your live campaigns. - Works with developer tokens that have Test Access level. |\n| ##### Disadvantages | - A programming bug in the development phase could affect live campaign serving, leading to issues such as poor campaign performance, incorrect serving, or financial losses. - The developer token should have at least the Basic Access level to in order to make API calls. | - You must reconstruct campaigns within test accounts to test code that works against specific account contents. - Since test accounts don't serve ads, features related to live serving such as reporting stats, policy violation errors, or processing offline conversion imports are not supported, making it difficult to test those features. |\n\nWe recommend using a test account while developing your application when\npossible. For instructions, see [Create test accounts and\ncampaigns](/google-ads/api/docs/best-practices/test-accounts#create).\n\nAn alternative is to set up a production account with a low account budget,\nsuch as $1/day, explicitly for testing features that are not supported by a\ntest account.\n\nChoice of feature set\n---------------------\n\nWhen choosing an account for making API call, an additional consideration is\nthe list of features you'd want to use with the API. Even if you choose to use\na production account, there are some features that are account-specific, for\nexample:\n\n- For billing features, you need an account that is on monthly invoicing.\n- Some new features in the account might be restricted by allowlists.\n\nBefore finalizing the account to make API calls against, check the\ndocumentation of the specific feature to make sure that the feature doesn't\nhave additional restrictions.\n\nIdentify the login customer ID and customer ID\n----------------------------------------------\n\nTo make an API call to a Google Ads customer, you must grant access and\nappropriate permissions to your service account to the customer account\neither directly or through a linked manager account. To do this, you need\nadministrator access to the customer account.\n\nStart by signing in to your Google Ads account as an administrator. In some cases,\nyou might have more than one customer account to choose from. The account you\nselect establishes the login customer ID, which is a required header for some\nAPI calls.\n\nAfter you've identified the Google Ads customer to make API calls to, note the\nfollowing details:\n\n- The 10-digit customer ID of the customer account to which you plan to make\n API calls against. This is sometimes referred to as the operating customer.\n\n- The 10-digit login customer ID of the customer account you're signed in to.\n If you're signed in to the operating customer, the login customer ID is the\n same as the customer ID. If you signed into a manager account of the\n operating customer, the login customer ID is the customer ID of the manager\n account.\n\nGrant access to the service account\n-----------------------------------\n\n1. While signed in to your Google Ads account as an administrator, navigate to\n **Admin \\\u003e Access and security**.\n\n2. Click the **+** button under the **Users** tab.\n\n3. Type the service account email address into the **Email** input box. Select\n the appropriate level of account access level and click the **Add account**\n button. Note that Email access level is not supported for service accounts.\n\n4. The service account is granted access.\n\nBy default, you cannot grant administrator access to a service account. If your\nAPI calls require administrator access, you can upgrade the access as follows.\n\n1. Click the drop-down arrow next to the access level of the service account\n in the **Access level** column.\n\n2. Select **Admin** from the drop-down list."]]