שירות DoubleClick Campaigns
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
השירות DoubleClick Campaigns מאפשר להשתמש ב-DCM/DFA Reporting and Trafficking API ב-Google Apps Script. ה-API הזה מספק גישה פרוגרמטית לדיווח של DoubleClick Campaign Manager (DCM) ושל DoubleClick Digital Marketing (DDM).
מידע מפורט על השירות הזה מופיע במאמרי העזרה בנושא DCM/DFA Reporting and Trafficking API. בדומה לכל השירותים המתקדמים ב-Apps Script, השירות DoubleClick Campaigns משתמש באותם אובייקטים, שיטות ופרמטרים כמו ה-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);}}
קבלת רשימה של קמפיינים פעילים
בדוגמה הזו מתועדים השמות והמזהים של כל הקמפיינים הפעילים. שימו לב לשימוש באסימוני החלפה כדי לאחזר את הרשימה כולה.
/** * 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)."],[],[]]