This guide provides a step-by-step approach to embedding the advanced tracking script and mapping variables to capture specific user interactions and data effectively.
Enhance your A/B testing and personalization efforts by integrating Convert's advanced tracking code into your Salesforce Commerce Cloud site.
Prerequisites
- Administrative access to Salesforce Commerce Cloud Business Manager.
- Familiarity with editing ISML templates.
- Access to Salesforce Commerce Cloud documentation for referencing data object mappings.
Step 1: Locate the Template
Identify the ISML template responsible for the <head>
tag across your site pages. Typically, this is the header.isml
template, which serves as the global template for the head section.
Step 2: Edit the Template and Map Variables
-
Access the Template: Navigate to the
header.isml
template within your development environment or via Business Manager atAdministration > Sites > Manage Sites > Your Site > Development > Templates
. -
Insert and Customize the Tracking Code: Place the advanced tracking code within the
<head>
section. Customize the variables by mapping them to Salesforce Commerce Cloud data objects, as shown below. Be sure to reference the official Salesforce Commerce Cloud documentation to ensure correct mappings:htmlCopy code<!-- begin Convert Experiences code -->
<script type="text/javascript">
// Example mappings of Convert variables to Salesforce Commerce Cloud data objects
var _conv_page_type = "home"; // Dynamically set based on SFCC page type
var _conv_category_id = "${CurrentCategory.ID}"; // Verify against SFCC documentation
var _conv_category_name = "${CurrentCategory.DisplayName}"; // Verify against SFCC documentation
var _conv_product_sku = "${CurrentProduct.SKU}"; // Verify against SFCC documentation
var _conv_product_name = "${CurrentProduct.Name}"; // Verify against SFCC documentation
var _conv_product_price = "${CurrentProduct.Price}"; // Verify against SFCC documentation
var _conv_customer_id = "${CurrentCustomer.ID}"; // Verify against SFCC documentation
var _conv_custom_v1 = "additional info"; // Custom variable for extra data
var _conv_custom_v2 = ""; // Additional custom variable
var _conv_custom_v3 = ""; // Additional custom variable
var _conv_custom_v4 = ""; // Additional custom variable
</script>
<script type="text/javascript" src="//cdn-4.convertexperiments.com/v1/js/xxxxxx-yyyyyy.js"></script>
<!-- end Convert Experiences code -->Replace the
xxxxxx-yyyyyy
with the numbers corresponding to your Convert project tracking code.
Step 3: Verify Installation
To confirm that the Convert tracking code has been installed correctly, please refer to the following resource:
Conclusion
Embedding Convert's advanced tracking code directly into your Salesforce Commerce Cloud templates allows for detailed analytics on user behavior, enhancing personalization and testing strategies. This setup ensures that data is accurately tracked and leveraged for impactful experiments and optimized user experiences. To access the latest Salesforce Commerce Cloud documentation for accurate data object mappings, visit the Salesforce help portal or access the developer documentation section within your Salesforce account.