Skip to main content

What is the CC SDK?

The CreatorCommerce SDK is a lightweight JavaScript layer that detects affiliate context from incoming links and stores it in Shopify cart attributes. It runs automatically in the background — once enabled, it handles:
  • Shopper context detection — When a user arrives through an affiliate link, the SDK reads the creator, campaign, and shop identifiers from the URL
  • Cart attribute persistence — The SDK writes cc-creator-handle, cc-creator-id, cc-campaign-id, and cc-shop-id to the Shopify cart
  • Automatic updates — If the shopper clicks a different affiliate link, the SDK seamlessly updates the cart attributes to reflect the new context
  • Personalization triggers — Once cart attributes are set, your Liquid templates can resolve the full creator metaobject and personalize the experience

Installation

The SDK is delivered as a Shopify Theme App Embed. To enable it:
1

Go to Theme App Embeds

In Shopify Admin → Online Store → Themes → Customize → App Embeds
2

Enable CreatorCommerce SDK

Toggle the CreatorCommerce SDK embed to ON and save.
No code changes are required. The SDK inject runs on every page of your theme once enabled.

Cart Attributes Set by the SDK

When a shopper arrives through an affiliate link, the SDK writes these attributes:
AttributeExample ValuePurpose
cc-creator-handle"tiffanyhoughton"Primary key for resolving the creator metaobject
cc-creator-id"677c1a5b7ea8a6e015ab46f3"CreatorCommerce internal creator ID
cc-campaign-id"6765aa58f5ea34a02280fd3e"Campaign the creator belongs to
cc-shop-id"677c1a5b7ea8a6e015ab46f3"CreatorCommerce shop identifier

Basic Liquid Usage

Once the SDK sets cart attributes, resolve the creator in any section or snippet:
{% liquid
  if metaobject
    assign cc_creator = metaobject
  else
    assign cc_handle = cart.attributes['cc-creator-handle']
    assign cc_creator = metaobjects.creator[cc_handle]
  endif
  
  assign has_creator = cc_creator != blank
%}

{% if has_creator %}
  <h1>{{ cc_creator.cc-creator-first-name }}'s Picks</h1>
{% endif %}
Place this block at the top of any section or snippet that needs creator context. It’s safe to call everywhere — if no creator is present, cc_creator will be blank and conditional blocks won’t render.

Verifying the SDK

To confirm the SDK is working, open your browser console on any page after clicking an affiliate link and run:
fetch(window.Shopify.routes.root + 'cart.js')
  .then(response => response.json())
  .then(cart => {
    console.log('Cart attributes:', cart.attributes);
    if (cart.attributes['cc-creator-handle']) {
      console.log('✅ SDK is active. Creator:', cart.attributes['cc-creator-handle']);
    } else {
      console.log('❌ No CC attributes found. Check that the SDK embed is enabled.');
    }
  });
You should see the cc- attributes in the response if the SDK is active.

How Attribute Updates Work

ScenarioBehavior
Shopper clicks Creator A’s linkAttributes set to Creator A
Same shopper clicks Creator B’s linkAttributes overwritten to Creator B
Shopper visits directly (no affiliate link)Existing attributes persist from last affiliate visit
Cart is emptied / new sessionAttributes cleared with the cart

Next Steps

Referencing Creator Content

Access all creator fields on any page

Enable Tracking

Set up full funnel tracking with the SDK + web pixel