---
title: Third-party integrations - Web
description: Resources to learn more about Contentsquare and third-party integrations
lastUpdated: 29 January 2026
source_url:
  html: https://docs.contentsquare.com/en/web/third-party-integrations-and-implementation-examples/
  md: https://docs.contentsquare.com/en/web/third-party-integrations-and-implementation-examples/index.md
---

## Google Analytics 360 connector

Read the [related documentation ↗](https://support.contentsquare.com/hc/categories/360002508439).

## Adobe Analytics connector

Read the [related documentation ↗](https://support.contentsquare.com/hc/categories/360002508439).

## A/B Testing solutions

You can send the variants from A/B Testing solution (ABTasty, Kameleoon, Monetate, Google Optimize, Dynamic Yield, Qubit, VWO, Optimizely, Usabilla, Maxymiser, Adobe Test and Target...)

Read the [related documentation ↗](https://support.contentsquare.com/hc/categories/360002508439).

## Miscellaneous Implementation samples

## Adblock detection

If you want to detect if the user is using Adblock, you could send this information using a custom var. The following code is an example on how to do it:

```javascript
(function () {
  var test = document.createElement("div");
  test.innerHTML = "&nbsp;";
  test.className = "adsbox";
  document.body.appendChild(test);
  window._uxa = window._uxa || [];
  if (test.offsetHeight === 0) window._uxa.push(["setCustomVariable", 1, "isAdblock", true]);
  else window._uxa.push(["setCustomVariable", 1, "isAdblock", false]);
  test.remove();
})();
```

## Get Contentsquare session context (for integrations)

### getSessionKey

The `getSessionKey` command allows for retrieving a unique Contentsquare session key. It's a string that encodes both a `userId` and a `sessionNumber`, in the form `<userId>.<sessionNumber>` (example: `"59e73d8b-2730u283i20-6712c43aaab3.3"`). You can also provide a callback function:

```javascript
function csCallback(sessionKey) {
  const [userId, sessionNumber] = sessionKey.split(".");
  // do something with the session key
}


window._uxa = window._uxa || [];
_uxa.push(["getSessionKey", { callback: csCallback }]);
```

### afterPageView

The `afterPageView` command allows for executing a `callback` after the "natural" pageview or "artificial" pageview (`trackPageview` command).

**You don't need to wait for the Contentsquare tag to be fired to send this command.**

If the command is called after the natural pageview, the callback is executed immediately and then after each `trackPageview`. You can register multiple callbacks by calling the command multiple times.

The `callback` is called with a `context` which contains:

* `projectId`
* `sessionKey`
* `pageNumber`
* `replayConsentRequired`
* `replayConsent`

`context.sessionKey` is a unique session identifier. It's a string that encodes both a `userId` and a `sessionNumber`, in the form `<userId>.<sessionNumber>` (example: `"59e73d8b-2730u283i20-6712c43aaab3.3"`).

`userId` is a unique anonymous ID generated by Contentsquare.

`sessionNumber` is the position of the session in all the sessions tracked by Contentsquare for the same user (based on cookie tracking). So if `sessionNumber` is 3, it means that it's the third session tracked for this user.

Here's an example which shows how to get the session context and use it in your callback:

```javascript
function csCallback(context) {
  const projectId = context.projectId;
  const [userId, sessionNumber] = context.sessionKey.split(".");
  const pageNumber = context.pageNumber;
  // do something with the session context
}


window._uxa = window._uxa || [];
_uxa.push(["afterPageView", csCallback]);
```
