Appearance
Tag Implementation Guide
This guide explains how to implement the Click2Buy tag on your order confirmation page(s) to validate orders.
Prerequisites
Before proceeding, ensure you have your unique Retailer ID provided by your Click2Buy account manager.
WARNING
Important: You may receive the script via email. Since the code starts with https, email clients might display it as a hyperlink. Do NOT click on it. simply copy the code as text. The unique Retailer ID is already included in the snippet sent to you.
Integration Methods
You can choose between two integration methods:
- Google Tag Manager (GTM) - Recommended
- Native Code Integration
Method 1: Google Tag Manager (Recommended)
Using Google Tag Manager is the easiest and quickest way to implement our tag.
Steps:
- Log in to your GTM workspace.
- Click Add New Tag.
- Click Tag Configuration and select Custom HTML as the tag type.
- Copy and paste the following script into the HTML field.
- Replace
ID_RETAILERwith your actual Retailer ID.
- Replace
html
<script>
(function(i,s,o,g,r,a,m){
i[r] = i[r] || {q:[],validationProcess:function(){
i[r].q.push(arguments)
}};
a = s.createElement(o);
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a,m);
})(window,document,'script','https://rs.clic2buy.com/retailers/ID_RETAILER.js','C2B');
C2B.validationProcess();
</script>- Click Triggering and choose the trigger that fires on your Order Confirmation Page.
- If you don't have this trigger, see the Troubleshooting section below.
- Save the tag.
- Publish your changes by clicking Submit and then Publish.
Method 2: Native Code Integration
To integrate the tag directly into your website's code:
- Locate the HTML file for your Order Confirmation Page.
- Paste the following code just before the closing
</body>tag. - Replace
ID_RETAILERwith your unique Retailer ID.
html
<script>
(function(i,s,o,g,r,a,m){
i[r] = i[r] || {q:[],validationProcess:function(){
i[r].q.push(arguments)
}};
a = s.createElement(o);
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a,m);
})(window,document,'script','https://rs.clic2buy.com/retailers/ID_RETAILER.js','C2B');
C2B.validationProcess();
</script>Troubleshooting
How do I create a new trigger for the Order Confirmation Page?
If you don't have an existing trigger for your order confirmation page in GTM, follow these steps:
- Go to the Triggers section in GTM.
- Click New.
- Name the trigger (e.g., "Order Confirmation Page").
- Click Trigger Configuration and select Page View.
- Select Some Page Views.
- Define the condition:
- Select Page URL -> contains -> enter a unique part of your confirmation page URL (e.g.,
/checkout/successororder-confirmed).
- Select Page URL -> contains -> enter a unique part of your confirmation page URL (e.g.,
- Save the trigger.
You can now use this trigger when configuring your tag.