DoubleClick Campaigns 서비스를 사용하면 Apps Script에서 DCM/DFA Reporting API 및 Trafficking API를 사용할 수 있습니다. 이 API는 DoubleClick Campaign Manager (DCM) 및 DoubleClick Digital Marketing (DDM) 보고에 대한 프로그래매틱 액세스를 제공합니다.
참조
이 서비스에 대한 자세한 내용은 DCM/DFA Reporting and Trafficking API의 참조 문서를 참고하세요. Apps Script의 모든 고급 서비스와 마찬가지로 DoubleClick 캠페인 서비스는 공개 API와 동일한 객체, 메서드, 매개변수를 사용합니다. 자세한 내용은 메서드 서명이 결정되는 방식을 참고하세요.
/** * Logs all of the user profiles available in the account. */functionlistUserProfiles(){// Retrieve the list of available user profilestry{constprofiles=DoubleClickCampaigns.UserProfiles.list();if(profiles.items){// Print out the user ID and name of eachfor(leti=0;i < profiles.items.length;i++){constprofile=profiles.items[i];console.log('Found profile with ID %s and name "%s".',profile.profileId,profile.userName);}}}catch(e){// TODO (Developer) - Handle exceptionconsole.log('Failed with error: %s',e.error);}}
활성 캠페인 목록 가져오기
이 샘플은 모든 활성 캠페인의 이름과 ID를 로깅합니다. 전체 목록을 가져오기 위해 페이지로 나누기 토큰을 사용합니다.
/** * Logs names and ID's of all active campaigns. * Note the use of paging tokens to retrieve the whole list. */functionlistActiveCampaigns(){constprofileId='1234567';// Replace with your profile ID.constfields='nextPageToken,campaigns(id,name)';letresult;letpageToken;try{do{result=DoubleClickCampaigns.Campaigns.list(profileId,{'archived':false,'fields':fields,'pageToken':pageToken});if(result.campaigns){for(leti=0;i < result.campaigns.length;i++){constcampaign=result.campaigns[i];console.log('Found campaign with ID %s and name "%s".',campaign.id,campaign.name);}}pageToken=result.nextPageToken;}while(pageToken);}catch(e){// TODO (Developer) - Handle exceptionconsole.log('Failed with error: %s',e.error);}}
새 광고주 및 캠페인 만들기
이 샘플은 새 광고주를 만들고 해당 광고주로 새 캠페인을 만듭니다. 캠페인은 한 달 동안 진행되도록 설정되어 있습니다.
/** * Creates a new advertiser, and creates a new campaign with that advertiser. * The campaign is set to last for one month. */functioncreateAdvertiserAndCampaign(){constprofileId='1234567';// Replace with your profile ID.constadvertiser={name:'Example Advertiser',status:'APPROVED'};try{constadvertiserId=DoubleClickCampaigns.Advertisers.insert(advertiser,profileId).id;constlandingPage={advertiserId:advertiserId,archived:false,name:'Example landing page',url:'https://www.google.com'};constlandingPageId=DoubleClickCampaigns.AdvertiserLandingPages.insert(landingPage,profileId).id;constcampaignStart=newDate();// End campaign after 1 month.constcampaignEnd=newDate();campaignEnd.setMonth(campaignEnd.getMonth()+1);constcampaign={advertiserId:advertiserId,defaultLandingPageId:landingPageId,name:'Example campaign',startDate:Utilities.formatDate(campaignStart,'GMT','yyyy-MM-dd'),endDate:Utilities.formatDate(campaignEnd,'GMT','yyyy-MM-dd')};DoubleClickCampaigns.Campaigns.insert(campaign,profileId);}catch(e){// TODO (Developer) - Handle exceptionconsole.log('Failed with error: %s',e.error);}}
[[["이해하기 쉬움","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-08-31(UTC)"],[[["\u003cp\u003eThe DoubleClick Campaigns service enables programmatic access to DoubleClick Campaign Manager (DCM) and DoubleClick Digital Marketing (DDM) Reporting within Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eIt's an advanced service that requires enabling before use and mirrors the functionality of the DCM/DFA Reporting and Trafficking API.\u003c/p\u003e\n"],["\u003cp\u003eProvided sample code demonstrates how to list user profiles, get active campaigns, and create advertisers and campaigns using the service.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage the service to automate tasks, extract data, and manage DCM/DDM entities directly from their Apps Script projects.\u003c/p\u003e\n"]]],[],null,[]]