Skip to content

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:

  1. Google Tag Manager (GTM) - Recommended
  2. Native Code Integration

Using Google Tag Manager is the easiest and quickest way to implement our tag.

Steps:

  1. Log in to your GTM workspace.
  2. Click Add New Tag.
  3. Click Tag Configuration and select Custom HTML as the tag type.
  4. Copy and paste the following script into the HTML field.
    • Replace ID_RETAILER with your actual 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>
  1. Click Triggering and choose the trigger that fires on your Order Confirmation Page.
  2. Save the tag.
  3. Publish your changes by clicking Submit and then Publish.

Method 2: Native Code Integration

To integrate the tag directly into your website's code:

  1. Locate the HTML file for your Order Confirmation Page.
  2. Paste the following code just before the closing </body> tag.
  3. Replace ID_RETAILER with 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:

  1. Go to the Triggers section in GTM.
  2. Click New.
  3. Name the trigger (e.g., "Order Confirmation Page").
  4. Click Trigger Configuration and select Page View.
  5. Select Some Page Views.
  6. Define the condition:
    • Select Page URL -> contains -> enter a unique part of your confirmation page URL (e.g., /checkout/success or order-confirmed).
  7. Save the trigger.

You can now use this trigger when configuring your tag.