# Installing the code snippet on Salesforce Commerce Cloud

This doc explains how to deploy the CustomFit.ai code snippet inside a Salesforce Commerce Cloud storefront so you can run A/B tests, personalization campaigns, and behavior-based targeting.

**Prerequisites**

Make sure you have:

* Admin access to **Salesforce Commerce Cloud Business Manager**
* Permission to edit ISML templates
* Your CustomFit.ai project script (available in your CustomFit dashboard)

### Step 1: Identify the Global Head Template

CustomFit’s script must load on every page of your storefront.

In most Salesforce Commerce Cloud implementations, the shared `<head>` section is controlled by a template such as:

```
header.isml
```

This template ensures your tracking script runs consistently across homepage, category, product, and checkout pages.

If your project uses a custom structure, locate the ISML file responsible for rendering the `<head>` tag globally.

### Step 2: Insert the CustomFit.ai Tracking Script

Locate the ISML file responsible for rendering the global `<head>` section of your storefront. In most Salesforce Commerce Cloud implementations, this is the `header.isml` template.

You can access it either through your local development environment or directly from Business Manager by navigating to:

**Administration → Sites → Manage Sites → \[Your Site] → Development → Templates**

Once there, open the template file that controls the shared head markup across your site pages.&#x20;

Insert the CustomFit.ai code snippet inside the `<head>` section of the template. Placing it here ensures the script loads consistently across all storefront pages.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.customfit.ai/master/installing-customfit-code-snippet/installing-the-code-snippet-on-salesforce-commerce-cloud.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
