Implement Converge JS Pixel with the Typescript SDK
Create a new Client Source in Converge
{Storename} Storefront
Install the Converge HTML snippet in your storefront
HTML
, and copy the first <script>
tag from the snippet.Code example
</head>
tag.Add the Converge Typescript SDK
Verify that the integration is working correctly
$page_load
events by visiting the website and seeing that these events arrive in the Source Log.myfirstdomain.com
and on checkout.myfirstdomain.com
, the sessions should be stitched across both domains automatically.
If you want to stitch a session from myfirstdomain.com
to myotherdomain.com
then you will want to make sure to implement it as per the instructions below.
__cvg_uid
and __cvg_sid
parameters and cookies.
If Converge recognizes the same __cvg_uid
and __cvg_sid
identifiers for pageviews on myfirstdomain.com
and pageviews on myotherdomain.com
then it will stitch those sessions under the same profile and session.
To stitch, we need to be able to pass the cookie between different websites as the cookie is only generated if the __cvg_uid
and __cvg_sid
are not set in the URL.
If there is a __cvg_uid
set in the URL as a parameter, the cookie will be set to this value.
link_domain
methodlink_domain
method to automatically add the ?__cvg_uid={CVG_ID_VALUE}&__cvg_sid={CVG_SID_VALUE}
suffix to every outbound link that leads to myotherdomain.com
.
Include the following method together with the basic Converge pixel snippet on the myfirstdomain.com
website to enable it on every page.
__cvg_uid
and __cvg_sid
are present after navigating to another domain. If those are missing, Converge has no way of stitching the events correctly. This will potentially lead to sessions being attributed as organic referrals from your other domain.myotherdomain.com
does not happen directly through a link click, but for example, through JS code, the parameter won’t be added automatically.You should follow Manually setting up cross-domain tracking, to manually instrument the links.link_domain
cannot be used in your case, you will need to manually instrument the links by adding the __cvg_uid
and __cvg_sid
URL parameters and their corresponding cookie values for each outbound link in that case.
The procedure for this will vary depending on your specific requirements. But in general, it consists of fetching the necessary cookie values and appending them to the URL before redirecting.
For example, assuming you are navigating to another domain using a click event on a button, one possible approach is the following:
__cvg_uid
and __cvg_sid
are present after navigating to another domain. If those are missing, Converge has no way of stitching the events correctly. This will potentially lead to sessions being attributed as organic referrals from your other domain.track
method in the Converge Pixel for this purpose.
properties
, profileProperties
and aliases
as possible eventName
: The name of the eventproperties
: The event properties you want to pass, covering the Converge Spec and possibly your own custom properties.profileProperties
: The profile propertiesaliases
: Any aliasesCode Examples
internalUser=1
query parameter to the URL of the page you’re visiting, you can prevent the Converge pixel from executing.
As a consequence, no events or sessions will be tracked. For example:
https://mywebsite.com?internalUser=1
https://mywebsite.com/product-1?internalUser=1
https://mywebsite.com/product-1?utm_source=test&internalUser=1
__cvg_internal_user
cookie and will persist for this browser, for as long as the cookie is present (up to 2 years).When conducting internal testing, it is advised to regularly add the internalUser=1
query parameter to the URL to prevent tracking.