বিজ্ঞাপন কাস্টমাইজার
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
একটি বিজ্ঞাপন কাস্টমাইজার ডেটা উৎস তৈরি করুন
function createMixersAdCustomizerSource() { // This example snippet creates an ad customizer source named "Mixers", modeled after // the example data shown at https://support.google.com/google-ads/answer/6072565. const sourceName = 'Mixers'; // Ad Customizer attributes can be added one at a time with `addAttribute` or all at // once with `addAttributes`. const mixersSourceOperation = AdsApp.newAdCustomizerSourceBuilder() .withName(sourceName) .addAttribute('Model', 'text') .addAttributes({ 'Capacity': 'number', 'Type': 'text', 'Start_price': 'price', 'Sale_ends': 'date', }) .build(); return mixersSourceOperation; }
নাম অনুসারে একটি বিজ্ঞাপন কাস্টমাইজার ডেটা উৎস খুঁজুন
function getAdCustomizerSourceByName(sourceName) { let sourceCount = 0; let foundSource = null; for (const source of AdsApp.adCustomizerSources()) { if (source.getName() === sourceName) { foundSource = source; sourceCount += 1; } } if (foundSource === null) { throw new Error(`No Ad Customizer Source found with name "${sourceName}"`); } if (sourceCount > 1) { console.warn(`Found ${sourceCount} Ad Customizer Sources with name "${sourceName}", returning just one of them`); } console.log(`Source "${foundSource.getName()}" has attributes ${foundSource.getAttributes()}`); return foundSource; }
একটি ডেটা উৎসের কাস্টমাইজার আইটেম পান
function getAdCustomizerItems(sourceName) { let sourceCount = 0; let foundSource = null; for (const source of AdsApp.adCustomizerSources()) { if (source.getName() === sourceName) { foundSource = source; sourceCount += 1; } } if (foundSource === null) { throw new Error(`No Ad Customizer Source found with name "${sourceName}"`); } if (sourceCount > 1) { console.warn(`Found ${sourceCount} Ad Customizer Sources with name "${sourceName}", using just one of them`); } const itemIterator = foundSource.items().get(); console.log(`Source "${foundSource.getName()}" has ${itemIterator.totalNumEntities()} items`); return itemIterator; }
একটি বিজ্ঞাপন কাস্টমাইজার আইটেম তৈরি করুন
function createMixersAdCustomizerItem() { // This example snippet creates an ad customizer item in the source named "Mixers", // modeled after the example data shown at // https://support.google.com/google-ads/answer/6072565. const sourceName = 'Mixers'; let sourceCount = 0; let mixersSource = null; for (const source of AdsApp.adCustomizerSources()) { if (source.getName() === sourceName) { mixersSource = source; sourceCount += 1; } } if (mixersSource === null) { throw new Error(`No Ad Customizer Source found with name "${sourceName}"`); } if (sourceCount > 1) { console.warn(`Found ${sourceCount} Ad Customizer Sources with name "${sourceName}", using just one of them`); } // Item values can be specified one at a time with `withAttributeValue` or all at once // with `withAttributeValues`. const mixersItemOperation = mixersSource.adCustomizerItemBuilder() .withAttributeValue('Model', 'ProWhip 300') .withAttributeValues({ 'Capacity': 5, 'Type': 'tilt-head', 'Start_price': '$199', 'Sale_ends': '20150515 200000', }) .withTargetKeyword('prowhip 300') .build(); return mixersItemOperation; }
বিজ্ঞাপন কাস্টমাইজার দিয়ে প্রসারিত পাঠ্য বিজ্ঞাপন তৈরি করুন
function createCustomizedMixersExpandedTextAd() { // This example snippet creates an ad in the ad group named "Kitchen Store" that // shows details based on the data in the ad customizer named "Mixers". This // example is modeled after https://support.google.com/google-ads/answer/6072565. const adGroupName = 'Kitchen Store'; const adGroupIterator = AdsApp.adGroups() .withCondition(`ad_group.name = "${adGroupName}"`) .get(); if (!adGroupIterator.hasNext()) { throw new Error(`No Ad Group found with name "${adGroupName}"`); } if (adGroupIterator.totalNumEntities() > 1) { console.warn(`Found ${adGroupIterator.totalNumEntities()} Ad Groups with name "${adGroupName}", using just one of them`); } const adGroup = adGroupIterator.next(); const mixersAdOperation = adGroup.newAd().expandedTextAdBuilder() .withHeadlinePart1('{=Mixers.model}') .withHeadlinePart2('Stand Mixer') .withDescription1('{=Mixers.Capacity} quart {=Mixers.Type} stand mixer.') .withDescription2('{=Mixers.Start_price} - sale ends in {=COUNTDOWN(Mixers.Sale_ends)}.') .withFinalUrl('http://www.example.com') .build(); return mixersAdOperation; }
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-21 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-08-21 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe provided code snippets demonstrate how to manage Ad Customizer data sources and items within Google Ads scripts.\u003c/p\u003e\n"],["\u003cp\u003eYou can create, find, and retrieve items from an Ad Customizer data source using dedicated functions.\u003c/p\u003e\n"],["\u003cp\u003eAd Customizer items can be associated with specific keywords for targeted ad delivery.\u003c/p\u003e\n"],["\u003cp\u003eThe code showcases how to build Expanded Text Ads that dynamically insert data from Ad Customizer sources using placeholders like \u003ccode\u003e{=Mixers.Model}\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThese snippets use a 'Mixers' example source with attributes like Model, Capacity, and Sale_ends to illustrate the functionality.\u003c/p\u003e\n"]]],[],null,["Create an ad customizer data source \n\n```mysql\nfunction createMixersAdCustomizerSource() {\n // This example snippet creates an ad customizer source named \"Mixers\", modeled after\n // the example data shown at https://support.google.com/google-ads/answer/6072565.\n const sourceName = 'Mixers';\n\n // Ad Customizer attributes can be added one at a time with `addAttribute` or all at\n // once with `addAttributes`.\n const mixersSourceOperation = AdsApp.newAdCustomizerSourceBuilder()\n .withName(sourceName)\n .addAttribute('Model', 'text')\n .addAttributes({\n 'Capacity': 'number',\n 'Type': 'text',\n 'Start_price': 'price',\n 'Sale_ends': 'date',\n })\n .build();\n\n return mixersSourceOperation;\n}\n```\n\nFind an ad customizer data source by name \n\n```perl6\nfunction getAdCustomizerSourceByName(sourceName) {\n let sourceCount = 0;\n let foundSource = null;\n\n for (const source of AdsApp.adCustomizerSources()) {\n if (source.getName() === sourceName) {\n foundSource = source;\n sourceCount += 1;\n }\n }\n\n if (foundSource === null) {\n throw new Error(`No Ad Customizer Source found with name \"${sourceName}\"`);\n }\n\n if (sourceCount \u003e 1) {\n console.warn(`Found ${sourceCount} Ad Customizer Sources with name \"${sourceName}\", returning just one of them`);\n }\n\n console.log(`Source \"${foundSource.getName()}\" has attributes ${foundSource.getAttributes()}`);\n return foundSource;\n}\n```\n\nGet a data source's customizer items \n\n```perl6\nfunction getAdCustomizerItems(sourceName) {\n let sourceCount = 0;\n let foundSource = null;\n\n for (const source of AdsApp.adCustomizerSources()) {\n if (source.getName() === sourceName) {\n foundSource = source;\n sourceCount += 1;\n }\n }\n\n if (foundSource === null) {\n throw new Error(`No Ad Customizer Source found with name \"${sourceName}\"`);\n }\n\n if (sourceCount \u003e 1) {\n console.warn(`Found ${sourceCount} Ad Customizer Sources with name \"${sourceName}\", using just one of them`);\n }\n\n const itemIterator = foundSource.items().get();\n console.log(`Source \"${foundSource.getName()}\" has ${itemIterator.totalNumEntities()} items`);\n return itemIterator;\n}\n```\n\nCreate an ad customizer item \n\n```mysql\nfunction createMixersAdCustomizerItem() {\n // This example snippet creates an ad customizer item in the source named \"Mixers\",\n // modeled after the example data shown at\n // https://support.google.com/google-ads/answer/6072565.\n const sourceName = 'Mixers';\n\n let sourceCount = 0;\n let mixersSource = null;\n\n for (const source of AdsApp.adCustomizerSources()) {\n if (source.getName() === sourceName) {\n mixersSource = source;\n sourceCount += 1;\n }\n }\n\n if (mixersSource === null) {\n throw new Error(`No Ad Customizer Source found with name \"${sourceName}\"`);\n }\n\n if (sourceCount \u003e 1) {\n console.warn(`Found ${sourceCount} Ad Customizer Sources with name \"${sourceName}\", using just one of them`);\n }\n\n // Item values can be specified one at a time with `withAttributeValue` or all at once\n // with `withAttributeValues`.\n const mixersItemOperation = mixersSource.adCustomizerItemBuilder()\n .withAttributeValue('Model', 'ProWhip 300')\n .withAttributeValues({\n 'Capacity': 5,\n 'Type': 'tilt-head',\n 'Start_price': '$199',\n 'Sale_ends': '20150515 200000',\n })\n .withTargetKeyword('prowhip 300')\n .build();\n\n return mixersItemOperation;\n}\n```\n\nCreate expanded text ad with ad customizers \n\n```gdscript\nfunction createCustomizedMixersExpandedTextAd() {\n // This example snippet creates an ad in the ad group named \"Kitchen Store\" that\n // shows details based on the data in the ad customizer named \"Mixers\". This\n // example is modeled after https://support.google.com/google-ads/answer/6072565.\n const adGroupName = 'Kitchen Store';\n const adGroupIterator = AdsApp.adGroups()\n .withCondition(`ad_group.name = \"${adGroupName}\"`)\n .get();\n\n if (!adGroupIterator.hasNext()) {\n throw new Error(`No Ad Group found with name \"${adGroupName}\"`);\n }\n\n if (adGroupIterator.totalNumEntities() \u003e 1) {\n console.warn(`Found ${adGroupIterator.totalNumEntities()} Ad Groups with name \"${adGroupName}\", using just one of them`);\n }\n\n const adGroup = adGroupIterator.next();\n const mixersAdOperation = adGroup.newAd().expandedTextAdBuilder()\n .withHeadlinePart1('{=Mixers.model}')\n .withHeadlinePart2('Stand Mixer')\n .withDescription1('{=Mixers.Capacity} quart {=Mixers.Type} stand mixer.')\n .withDescription2('{=Mixers.Start_price} - sale ends in {=COUNTDOWN(Mixers.Sale_ends)}.')\n .withFinalUrl('http://www.example.com')\n .build();\n\n return mixersAdOperation;\n}\n```"]]