অনুমোদন প্রয়োজন
একটি GTM নিয়ম আপডেট করে। এখন এটি চেষ্টা করুন বা একটি উদাহরণ দেখুন ।
অনুরোধ
HTTP অনুরোধ
PUT https://www.googleapis.com/tagmanager/v1/accounts/accountId/containers/containerId/rules/ruleId
পরামিতি
পরামিতি নাম | মান | বর্ণনা |
---|---|---|
পাথ প্যারামিটার | ||
accountId | string | GTM অ্যাকাউন্ট আইডি। |
containerId | string | GTM কন্টেইনার আইডি। |
ruleId | string | GTM নিয়ম আইডি। |
ঐচ্ছিক ক্যোয়ারী পরামিতি | ||
fingerprint | string | প্রদান করা হলে, এই আঙ্গুলের ছাপ অবশ্যই স্টোরেজের নিয়মের আঙ্গুলের ছাপের সাথে মিলবে। |
অনুমোদন
এই অনুরোধের জন্য নিম্নলিখিত সুযোগের সাথে অনুমোদনের প্রয়োজন ( প্রমাণিকরণ এবং অনুমোদন সম্পর্কে আরও পড়ুন )।
ব্যাপ্তি |
---|
https://www.googleapis.com/auth/tagmanager.edit.containers |
শরীরের অনুরোধ
অনুরোধের অংশে, নিম্নলিখিত বৈশিষ্ট্য সহ একটি নিয়ম সংস্থান সরবরাহ করুন:
সম্পত্তির নাম | মান | বর্ণনা | মন্তব্য |
---|---|---|---|
প্রয়োজনীয় বৈশিষ্ট্য | |||
condition[]. parameter[] | list | শর্তের প্রকারের উপর নির্ভর করে নামযুক্ত প্যারামিটারের একটি তালিকা (কী/মান)। মন্তব্য:
| লিখনযোগ্য |
condition[].parameter[]. type | string | পরামিতি প্রকার। বৈধ মান হল:
গ্রহণযোগ্য মান হল:
| লিখনযোগ্য |
condition[]. type | string | এই শর্তের জন্য অপারেটরের ধরন। গ্রহণযোগ্য মান হল:
| লিখনযোগ্য |
ঐচ্ছিক বৈশিষ্ট্য | |||
condition[] | list | শর্তগুলির তালিকা যা এই নিয়মটি তৈরি করে (অন্তর্ভুক্ত এবং তাদের মধ্যে)। | লিখনযোগ্য |
condition[].parameter[]. key | string | নামযুক্ত কী যা একটি প্যারামিটারকে অনন্যভাবে সনাক্ত করে। উচ্চ-স্তরের পরামিতি, সেইসাথে মানচিত্রের মানগুলির জন্য প্রয়োজনীয়। তালিকার মানগুলির জন্য উপেক্ষা করা হয়েছে৷ | লিখনযোগ্য |
condition[].parameter[]. list[] | list | এই তালিকা প্যারামিটারের পরামিতি (কীগুলি উপেক্ষা করা হবে)। | লিখনযোগ্য |
condition[].parameter[]. map[] | list | এই মানচিত্র প্যারামিটারের পরামিতি (কী থাকতে হবে; কী অনন্য হতে হবে)। | লিখনযোগ্য |
condition[].parameter[]. value | string | একটি প্যারামিটারের মান (ম্যাক্রো রেফারেন্স থাকতে পারে যেমন "") নির্দিষ্ট ধরনের জন্য উপযুক্ত। | লিখনযোগ্য |
name | string | নিয়ম প্রদর্শনের নাম। | লিখনযোগ্য |
notes | string | কনটেইনারে এই নিয়মটি কীভাবে প্রয়োগ করবেন সে সম্পর্কে ব্যবহারকারীর নোট। | লিখনযোগ্য |
প্রতিক্রিয়া
সফল হলে, এই পদ্ধতিটি প্রতিক্রিয়া বডিতে একটি নিয়ম সংস্থান প্রদান করে।
উদাহরণ
দ্রষ্টব্য: এই পদ্ধতির জন্য উপলব্ধ কোড উদাহরণগুলি সমস্ত সমর্থিত প্রোগ্রামিং ভাষার প্রতিনিধিত্ব করে না (সমর্থিত ভাষার তালিকার জন্য ক্লায়েন্ট লাইব্রেরি পৃষ্ঠা দেখুন)।
জাভা
জাভা ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।
/* * Note: This code assumes you have an authorized tagmanager service object. */ /* * This request updates an existing rule for the authorized user. */ // Construct the condition parameters. Parameter arg0 = new Parameter(); arg0.setType("template"); arg0.setKey("arg0"); arg0.setValue("{{url}}"); Parameter arg1 = new Parameter(); arg1.setType("template"); arg1.setKey("arg1"); arg1.setValue(".*hellowworld.html"); // Construct the condition object Condition condition = new Condition(); condition.setType("endsWith"); condition.setParameter(Arrays.asList(arg0, arg1)); // Construct the rule object. Rule rule = new Rule(); rule.setName("Updated Rule"); rule.setCondition(Arrays.asList(condition)); try { Rule response = tagmanager.accounts().containers(). rules().update("123456", "54321", "2", rule).execute(); } catch (GoogleJsonResponseException e) { System.err.println("There was a service error: " + e.getDetails().getCode() + " : " + e.getDetails().getMessage()); } /* * The results of the update method are stored in the response object. * The following code shows how to access the updated name and fingerprint. */ System.out.println("Updated Name = " + response.getName()); System.out.println("Updated Fingerprint = " + response.getFingerprint());
পাইথন
পাইথন ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।
# Note: This code assumes you have an authorized tagmanager service object. # This request updates an existing rule for the authorized user. try: response = tagmanager.accounts().containers().rules().update( accountId='123456', containerId='54321', ruleId='2', body={ 'name': 'Updated Ends with Rule', 'condition': [ { 'type': 'endsWith', 'parameter': [ { 'type': 'template', 'key': 'arg0', 'value': '{{url}}' }, { 'type': 'template', 'key': 'arg1', 'value': '.*hellowworld.html' } ] } ] } ).execute() except TypeError, error: # Handle errors in constructing a query. print 'There was an error in constructing your query : %s' % error except HttpError, error: # Handle API errors. print ('There was an API error : %s : %s' % (error.resp.status, error.resp.reason)) # The results of the update method are stored in the response object. # The following code shows how to access the updated name and fingerprint. print 'Updated Name = %s' % response.get('name') print 'Updated Fingerprint = %s' % response.get('fingerprint')
এটা চেষ্টা করুন!
লাইভ ডেটাতে এই পদ্ধতিতে কল করতে এবং প্রতিক্রিয়া দেখতে নীচের APIs এক্সপ্লোরার ব্যবহার করুন।