Configuration with HTML
Sometimes it’s useful to configure the Sovrn Commerce JavaScript Library differently for a certain page on your site, or even for just part of a page.
Commerce behavior can be configured by adding certain labels (called CSS “classes”) to your site’s HTML.
Classes
norewrite
When Commerce Convert is enabled (on by default), norewrite can be used to ensure links are never converted on specific parts of a page.
nooptimize
If Link Optimization is enabled, use nooptimize to ensure certain links are never optimized.
Examples
Prevent a single link from being monetized…
<a href="http://example.com" class="norewrite">Commerce ignores this</a>
…or a whole bunch of them:
<div class="norewrite">
None of these links will be monetized by Commerce. Not
<a href="http://example.com/1">this one</a>, or
even <a href="http://example.com/2">that one</a>.</div>
These classes can be used anywhere in your HTML and affect everything below. That means an entire page can be configured by adding one to the tag:
</header>
<body class="norewrite">
<div>Everything within the body will have no links monetized by Commerce Convert.
<p>Even child elements won't have anything monetized</p>
</div>
</body>
If your HTML already has another class where you’d like to use one of ours, just add a space between them. They’ll both work as expected:
<div class="myclass norewrite">
My content is amazing! Commerce will not monetize a click on any links.</div>
Updated about 2 years ago