Tracking Affiliate Links with Salesforce Commerce Cloud

GRIN lets you generate custom links for your Influencers, called affiliate links, to share with their audience and refer them to your products. GRIN also lets you track conversions on affiliate links, which means we can track when an affiliate link is used to make purchases in your store and attribute these purchases to the associated Influencer. This is great for tracking your ROI and which of your Influencers are the most successful. 

To track affiliate link conversions in your Commerce Cloud site, you first need to set up the affiliate integration.


We highly recommend a developer or integration partner on your team completes the affiliate integration process because it requires prior developer experience. If you need further technical support, please contact your CSM representative.

What You'll Need

  • The GRIN cartridge already installed in your Commerce Cloud environment 
  • Your brand you want to integrate with already set up in GRIN

Code Changes

  1. Load the templates/include/grinFooter.isml template from the int_grin cartridge.
  2. Include the template in the footer of every page. 
    • For SFRA-based environments, the template is located at ~templates/default/components/footer/pageFooter.isml
<iscomment>GRIN SDK</iscomment>
<isinclude template="/include/grinFooter" />
  1. Load the templates/tracking/grinConversionTracking.isml template from the int_grin cartridge.
  2. Include the template in the confirmation page after a successful checkout. 
    • For SFRA-based environments, the template is located at templates/default/checkout/confirmation/confirmation.isml
<iscomment>GRIN conversion tracking</iscomment>
<isinclude template="tracking/grinConversionTracking" />

You should now have both the JavaScript SDK library and conversion tracking script included. Your integration is now complete and ready to be tested. 

Enabling the Integration 

You can enable the SDK and conversion scripts by changing the GRIN configurations in the Business Manager. This lets you choose when you want to track affiliate conversions. To enable the integration: 

  1. Go to your Business Manager
  2. Navigate to Merchant Tools > Site Preferences > Custom Preferences


  1. Click on GRIN Configuration
  2. Select Yes for Enable GRIN Conversion Tracking
  3. Enter the URL for the GRIN Conversion Tracking SDK URL.


Congratulations! You're now set up to track affiliate links conversions in GRIN. 

Related Links 



Article is closed for comments.