<head>on any page where tests will be conducted. Our default code snippet utilizes the async attribute to load this script asynchronously:
useCanonicalDomainvariables to pull your page paths from the canonical URL element in your source code, these variables must be initialized after the
rel=canonicalelement loads in your site's header, and followed by the script tag which loads mab.js. Similarly, our code should load after your page
<title>tags near the top of the
<head>in this order:
rel=canonicallink element loads
noCookiesconfiguration variable set to
trueto disable Chartbeat's first-party cookies, Headline and Image Testing will not work. See our alternative website integrations page for instructions on how to customize your Chartbeat tracking code to use our noCookies variable in a way that is compatible with homepage testing.
<head>tag), after the
rel="canonical"link element in your HTML.
<body>, either by necessity of your tag manager platform or because your data layer is only available to initialize the section/author or subscriber variables later in the page load, you can load our testing code separately in the
<head>following the instructions below.
<head>after canonical URLs are loaded because it is responsible for altering the headlines and images in your homepage template to display test variants to your visitors, so this should happen before your CMS headlines and images become visible to the user to prevent "flicker" (more on flicker and how to prevent it in the next article of this guide).
mydomain.comin the mysub.domain.com article page Chartbeat code.
data-img-lg), you will need to set this variable to list the names of these lazy load attributes so our code can detect and replace those image urls. This variable accepts multiple comma separated string values as shown in the example below.
article, so if your site uses only
<article>tags to encapsulate your headline/image
<a>tags, you do not need to include this variable in your Chartbeat code snippet. However, if your site uses any additional tags for different image/headline link positions on your homepage, each of those elements needs to be assigned to this configuration variable separated by commas, as shown in the example below.