سرویس DoubleClick Campaigns به شما امکان می دهد از API گزارش دهی و ترافیک DCM/DFA در Apps Script استفاده کنید. این API دسترسی برنامهریزی شده به DoubleClick Campaign Manager (DCM) و DoubleClick Digital Marketing (DDM) Reporting را فراهم میکند.
مرجع
برای اطلاعات دقیق درباره این سرویس، به مستندات مرجع برای API گزارش دهی و قاچاق DCM/DFA مراجعه کنید. مانند همه سرویسهای پیشرفته در Apps Script، سرویس DoubleClick Campaigns از همان اشیا، روشها و پارامترهای API عمومی استفاده میکند. برای اطلاعات بیشتر، نحوه تعیین امضای روش را ببینید.
/** * Logs all of the user profiles available in the account. */ function listUserProfiles(){ // Retrieve the list of available user profiles try{ const profiles =DoubleClickCampaigns.UserProfiles.list();
if(profiles.items){ // Print out the user ID and name of each for(let i =0; i < profiles.items.length; i++){ const profile = profiles.items[i]; console.log('Found profile with ID %s and name "%s".', profile.profileId, profile.userName); } } }catch(e){ // TODO (Developer) - Handle exception console.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. */ function listActiveCampaigns(){ const profileId ='1234567';// Replace with your profile ID. const fields ='nextPageToken,campaigns(id,name)'; let result; let pageToken; try{ do{ result =DoubleClickCampaigns.Campaigns.list(profileId,{ 'archived':false, 'fields': fields, 'pageToken': pageToken }); if(result.campaigns){ for(let i =0; i < result.campaigns.length; i++){ const campaign = 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 exception console.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. */ function createAdvertiserAndCampaign(){ const profileId ='1234567';// Replace with your profile ID.
تاریخ آخرین بهروزرسانی 2025-01-05 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-01-05 بهوقت ساعت هماهنگ جهانی."],[[["The DoubleClick Campaigns service enables programmatic access to DoubleClick Campaign Manager (DCM) and DoubleClick Digital Marketing (DDM) Reporting within Apps Script."],["It's an advanced service that requires enabling before use and mirrors the functionality of the DCM/DFA Reporting and Trafficking API."],["Provided sample code demonstrates how to list user profiles, get active campaigns, and create advertisers and campaigns using the service."],["Developers can leverage the service to automate tasks, extract data, and manage DCM/DDM entities directly from their Apps Script projects."]]],[]]