Company

Code Snippets

Custom HTML, CSS, and JavaScript for your storefront.

Add custom HTML, CSS, or JavaScript to your storefront from my.clerk.io. Clerk.js loads the snippets on your site.

In my.clerk.io, open Developers > Code snippets.

Targeting and placement #

Run a snippet on every page or limit it to specific URLs.

To place HTML at a specific spot on a page, use a CSS selector to identify a part of the page, such as the area above the product grid.

Example use cases #

Think about where shoppers need to see or interact with the change. A snippet can be as small as a single banner or a CSS rule for one page.

  • Collect newsletter subscribers. Embed a signup form in your webshop. If checkout loads Clerk.js and has a newsletter checkbox, use a JavaScript snippet to capture checkout opt-ins in Clerk.io.
  • Add a sale banner. Insert an HTML banner above the product grid on your sale page to show when the promotion ends.
  • Fix mobile spacing. Use CSS to add space between product cards on a category page on small screens.

Ask Clerk.io #

Ask Clerk.io can help you write snippets and use them to troubleshoot issues on your storefront. See what Ask Clerk.io can do.