Third-party integrations
Google Analytics 360 connector
Section titled Google Analytics 360 connectorRead the related documentation ↗.
Adobe Analytics connector
Section titled Adobe Analytics connectorRead the related documentation ↗.
A/B Testing solutions
Section titled A/B Testing solutionsYou 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 ↗.
Miscellaneous Implementation samples
Section titled Miscellaneous Implementation samplesAdblock detection
Section titled Adblock detectionIf 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:
Get Contentsquare session context (for integrations)
Section titled Get Contentsquare session context (for integrations)getSessionKey
Section titled getSessionKeyThe 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:
afterPageView
Section titled afterPageViewThe 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: