广告 → 创建
AI-generatedOverview
This node integrates with the Google Ads API to manage advertising campaigns, ad groups, and ads. Specifically, for the "广告" (Ad) resource with the "创建" (Create) operation, it allows users to create new ads within a specified ad group in their Google Ads account.
Typical use cases include automating the creation of various types of ads such as text ads, image ads, video ads, or responsive search ads. This is beneficial for marketers who want to programmatically manage their ad inventory, quickly launch multiple ads, or integrate ad creation into larger automated workflows.
For example, a user can create a responsive search ad by specifying headlines, descriptions, final URLs, and display URL, all through this node, without manually using the Google Ads interface.
Properties
| Name | Meaning |
|---|---|
| 认证方式 | Authentication method to connect to Google Ads API. Options: OAuth2 (recommended), Service Account |
| 管理员客户ID | Manager customer ID associated with the Google Ads account |
| 客户ID | Client customer ID under which the ad will be created |
| 广告组ID | The ID of the ad group where the new ad will be created |
| 状态 | Status of the ad. Options: 启用 (ENABLED), 暂停 (PAUSED), 移除 (REMOVED) |
| 广告类型 | Type of the ad to create. Options: 文字广告 (TEXT_AD), 图片广告 (IMAGE_AD), 视频广告 (VIDEO_AD), 响应式搜索广告 (RESPONSIVE_SEARCH_AD) |
| 最终URL | Final URL(s) for the ad, multiple URLs separated by commas |
| 显示URL | Display URL shown on the ad |
| 标题 | Headlines for the ad, multiple titles separated by commas |
| 描述 | Descriptions for the ad, multiple descriptions separated by commas |
Output
The node outputs JSON objects representing the result of the ad creation operation. The output JSON typically contains details about the newly created ad, including its resource name and status as returned by the Google Ads API.
If the operation succeeds, the output includes the mutation response from the API confirming the creation. If an error occurs and the node is set to continue on failure, the output will contain an error message describing the issue.
No binary data output is produced by this node.
Dependencies
- Requires access to the Google Ads API.
- Requires either OAuth2 credentials or a service account credential configured in n8n.
- Needs developer token, manager customer ID, and client customer ID for authentication and authorization.
- Uses the
@htdangkhoa/google-adslibrary andgoogle-auth-libraryfor API communication and authentication.
Troubleshooting
- Authentication errors: Ensure that the OAuth2 tokens or service account credentials are valid and have the necessary permissions to manage ads.
- Invalid IDs: Verify that the provided manager customer ID, client customer ID, and ad group ID exist and are correct.
- API quota limits: Google Ads API enforces quotas; hitting these may cause errors. Monitor usage and request quota increases if needed.
- Malformed input: Make sure that fields like final URLs, headlines, and descriptions are properly formatted (e.g., comma-separated strings).
- Common error messages:
- "Invalid customer ID": Check that the customer ID is correctly entered and belongs to your account.
- "Permission denied": Confirm that the authenticated user has rights to create ads under the specified account.
- "Resource not found": The ad group ID might be incorrect or does not belong to the client customer ID.
Resolving these usually involves verifying credentials, input parameters, and ensuring proper API access.