DoubleClick 캠페인 서비스
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
DoubleClick Campaigns 서비스를 사용하면
DCM/DFA Reporting API 및 Trafficking API를
Google Apps Script에서 사용할 수 있습니다. 이 API는 DoubleClick Campaign Manager (DCM) 및 DoubleClick Digital Marketing (DDM) 보고에 대한 프로그래매틱 방식의 액세스를 제공합니다.
/** * 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"]],["최종 업데이트: 2026-05-05(UTC)"],[],[]]