Skip to content

Test the Client-side Script ​

This page explains how to check your client-side integration with our debug mode: you can test each step yourself, without placing an order, and without your tests being counted as sales.

Using server-side tracking? Its tests are described in the server-side installation guide.

While debug mode is on

Every sale sent from your browser is a test sale: it is recorded by Click2Buy, but never counted in the brands' statistics. This also applies to real orders placed in your browser while debug mode is on.

Turn on debug mode ​

1

Open your website and accept cookies

Use any page of your website. Our script is only loaded after consent: accept the cookies first, otherwise debug mode cannot start.

2

Add ?c2b_debug=1 to the URL

For example https://www.your-site.com/?c2b_debug=1 (or &c2b_debug=1 if the URL already has parameters). The parameter is then removed from the address bar.

3

The Click2Buy debug panel appears

It shows up in the bottom right corner of the page, and stays on every page of your website for 1 hour, including the checkout pages. It has four tabs, and stays on the tab you picked from one page to the next. The arrow button moves it to another corner, the – button minimizes it.

An Example Store page with the Click2Buy debug panel open in the bottom right corner, on its Test sale tab
The debug panel appears in the bottom right corner of your website

To turn debug mode off, click Disable in the panel, or open any page with ?c2b_debug=0. It also turns off by itself after 1 hour.

Check your integration ​

Follow the tabs of the panel from left to right: Config, Confirmation page and Test sale. The Journal tab is used in Check with a real order.

1. The script is installed ​

The Config tab shows your Retailer Key (Retailer line). If the panel does not appear at all, see Troubleshooting.

It also shows whether Click2Buy has enabled first-party tracking for your website (tracking_param_active and first_party_cookie_active).

2. Your confirmation page is recognised ​

This step only matters if Click2Buy has configured a validation URL for your website, so that the script detects your order confirmation page by itself. Otherwise, the sale is declared by the C2B.validationProcess(...) call of step 2 of the implementation, checked in Check with a real order.

In the Confirmation page tab:

  • This page tells whether the current page is recognised as a confirmation page.
  • Paste the URL of one of your order confirmation pages in the field and click Test: for each validation URL, the panel shows whether it matches, and why not. You do not need to reach the confirmation page for this.

On a page recognised as a confirmation page, the panel opens directly on this tab.

The Confirmation page tab: the current page does not match the validation URL, the pasted confirmation URL matches
The Confirmation page tab: the current page is not a confirmation page, the pasted URL is

3. The Click2Buy click is stored ​

A sale is only sent when the user came from Click2Buy, so a test sale also needs a Click2Buy click. The Attribution part of the Test sale tab shows the click stored in your browser, and offers two ways to get one:

  • Arrive from a real Click2Buy link (recommended): on a brand's website, open the Click2Buy widget on a product and select your website. With debug mode on, the panel then shows cid <id> under First party (or the content of the cookie under Third party, if first-party tracking is not enabled yet for your website). This also checks that the c2bm parameter survives your redirects and that the script is loaded on the landing page.
  • Simulate a click from the panel:
    • Simulate a first party click: available once Click2Buy has enabled first-party tracking for your website.
    • Simulate a third party click: available for every website, in Chrome only (other browsers block third-party cookies).

The Remove buttons delete the simulated clicks from your browser.

4. Send a test sale ​

Below, in the Order part of the same tab, adjust the amount, currency and product if you want, then click Send test sale. The panel shows the request sent to Click2Buy and its answer.

Test sale sent (validation_test) means the whole chain works: the script, the stored click and the connection to Click2Buy.

The Order part of the Test sale tab after a successful test sale: request sent, Test sale sent (validation_test), HTTP 200
A successful test sale: the request sent to Click2Buy and its answer

The Send test sale button is greyed out until a Click2Buy click is found (step 3).

Check with a real order ​

The test sale of the panel uses its own form: it does not check the data your confirmation page sends. To check it, place a real order with debug mode on (once is enough). The sale is recorded as a test sale.

On the order confirmation page, open the Journal tab of the panel (while another tab is open, it shows the number of new lines). It shows:

  • a conversion line with the trigger (explicit for a C2B.validationProcess(...) call, gtm_template for our Google Tag Manager template, url_match for a validation URL) and the order data received from your page: check the amount, currency and products;
  • a request line, then a response line with status 200.
The Journal tab on an order confirmation page: the order data received from the page (conversion line), the request sent to Click2Buy, then its response
The Journal tab on an order confirmation page: the order data received from the page (conversion), the request sent to Click2Buy, then its response

You can then cancel the order in your back office.

Troubleshooting ​

What you seeLikely causeWhat to do
No panel with ?c2b_debug=1The script is not loaded on this pageCheck that the script is loaded on every page, after the user's consent, and that cookies are accepted. If your website uses a CSP, allow rs.clic2buy.com (Content Security Policy)
The panel opens, then disappears when you reload or change pageYour CMP deletes the cookies that are not declared in its cookie list, including _c2b_debugDeclare _c2b_* in your CMP (Cookies). Otherwise _c2b_attr is deleted too, and sales are not attributed
The c2bm parameter (or the name configured for your website) is missing from the URL of the landing pageYour website removes URL parameters when redirectingKeep query parameters during redirects
No First party click after arriving from a Click2Buy linkThe script is not loaded on the landing page, or loaded too late after consentLoad the script on every page, right after consent, including on the landing page
Simulate a first party click is greyed outFirst-party tracking is not enabled yet for your websiteUse Simulate a third party click, or ask your Click2Buy contact
The simulated third party click says the browser blocks third-party cookiesSafari, Firefox and private browsing block themUse Chrome, in a normal window
Your confirmation URL does not matchThe validation URL configured by Click2Buy does not match your URLsSend the URL and the panel message to your Click2Buy contact
No conversion line in the Journal on the confirmation pageStep 2 of the implementation is missing, or your purchase tag did not fireCheck step 2 or your Google Tag Manager purchase tag
A response in red, or an error in the browser consoleThe request is blocked, often by a CSPAllow t.clic2buy.com and analytics.clic2buy.com (Content Security Policy)

Cookies set by debug mode ​

Debug mode only sets cookies in the browser of the person who turns it on, never for your visitors:

CookieDomainSet whenDuration
_c2b_debugYour websiteDebug mode is turned on1 hour
_c2b_debug_posYour websiteThe panel is moved to another corner1 hour
_c2b_debug_tabYour websiteAnother tab of the panel is opened1 hour
_c2b_attrYour websiteSimulate a first party click30 days
validation-<retailer key>clic2buy.comSimulate a third party click1 hour

_c2b_debug, _c2b_debug_pos and _c2b_debug_tab are removed when debug mode is turned off. The simulated clicks are removed with the Remove buttons of the panel.

If your CMP deletes undeclared cookies, these cookies are covered by the _c2b_* pattern to declare for the script (Cookies). The debug cookies can go in the strictly necessary or functional category.

Need help? ​

If something still does not work, contact your Click2Buy Retailer Account Manager, with a screenshot of the debug panel and the URL of the page: it shows us what happened at each step.