변형 전략
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 가이드는 기존 실적 최대화 가이드와 정확히 유사한 가이드를 제공하기 위해 작성되었습니다. 이 가이드에서는 각 항목을 개별 요청으로 한 번에 하나씩 만드는 대신 단일 원자 요청으로 전체 캠페인을 만들 것이라고 가정합니다. 즉, API 응답을 받기 전에는 전체 리소스 이름을 알 수 없으므로 임시 ID를 사용하여 리소스를 서로 연결해야 합니다.
이렇게 하려면 중복 임시 ID가 생성되지 않도록 하는 코드를 작성해야 합니다.
let nextId = -1;
function getNextTempId() {
const ret = nextId;
nextId -= 1;
return ret;
}
getNextTempId
를 연속으로 호출할 때마다 이전보다 1이 작은 숫자가 반환됩니다. 모든 임시 ID는 음수여야 하므로 -1부터 시작합니다.
이제 모든 작업을 보유할 배열을 만들 수 있습니다.
const operations = [];
모든 리소스 이름에 필요하므로 캠페인을 만드는 고객의 고객 ID가 자주 필요합니다.
const customerId = AdsApp.currentAccount().getCustomerId();
새 작업을 만들 때마다 리소스 이름에 다음 임시 ID를 사용하면 나중에 이 객체를 참조하고 생성된 객체를 배열에 삽입할 수 있습니다.
const newOperation = {
[OPERATION_TYPE_VARIES]: {
create: {
resourceName: `customers/${customerId}/[EXACT_PATH_VARIES]/${getNextTempId()}`
// Other fields, relevant to the resource being created.
}
}
}
operations.push(newOperation);
Google Ads API REST mutate 문서에서 자세한 내용을 읽고 작업 예시를 확인할 수 있습니다.
모든 작업을 구성한 후 단일 일괄 처리로 실행합니다.
AdsApp.mutateAll(operations);
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-06-04(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-06-04(UTC)"],[[["This guide provides instructions on creating Google Ads Performance Max campaigns using the Google Ads API with a single atomic request, as opposed to creating each entity individually."],["To link resources within the single request, temporary IDs are utilized and assigned with a function ensuring unique negative values for each."],["The guide involves constructing an array of operations, where each operation represents the creation of a specific campaign component."],["After defining all campaign elements and their relationships through the operations array, the entire campaign structure is created by executing a single batch mutation request via `AdsApp.mutateAll(operations)`."]]],[]]