---
schema_version: "1"
id: e903f9c57a4eff556f29bc9dc0e5f50d5094d875a60cd32dc807444a8d40fd95
title: Collect Tracking Code
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/mc_ctc_collect_code.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_collect_code.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7d01799579ac170e88507a046384310600c88a436fe4de43a6d0120c478337c0
description: Collect Tracking Code is a JavaScript snippet that captures data about the behaviors of known and unknown visitors to your site. You can use this data to enhance contact profiles and optimize customer journeys across channels through predictive and personalized recommendations. You can also update product and content catalog details in real time or track email-driven revenue.
products:
  - Marketing
  - Marketing Cloud Intelligence
release: "264"
---
# Collect Tracking Code

Collect Tracking Code is a JavaScript snippet that captures data about the behaviors of known and unknown visitors to your site. You can use this data to enhance contact profiles and optimize customer journeys across channels through predictive and personalized recommendations. You can also update product and content catalog details in real time or track email-driven revenue.

When a visitor goes to a website that uses the tracking code, the site leaves a cookie that contains a unique ID and session ID. The cookie adds an ID to all Collect calls. The cookie tracks the user until it’s removed or cleared.

Collect Tracking Code monitors the variables and events that you select at the contact level. It can monitor these visitor attributes:

- Browser type
- User location
- Session time and length
- Page URL
- Page title
- Referrer URL

All Collect calls associated with items, such as Track Item Detail, Track Cart, and Track Purchase, must match a value in the catalog. The Status tab in the Email or Web Recommendations application provides insight into whether Collect data matches catalog data.

Collect calls can’t pass more data about the page that you’re viewing, and the name-value pairs in the calls can't be changed. Values like `item`, `unique_id`, and `email` are fixed labels. Never replace fixed labels with custom labels.

- **[Install Collect Tracking Code](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_install_collect_code.htm&release=264.0.0&type=5)**  
    Learn how to configure your site to use Collect Tracking Code.
- **[Streaming Catalog Updates Through Collect Tracking Code](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_streaming_updates.htm&release=264.0.0&type=5)**  
    To configure server-side streaming updates for items in your catalog, use the API key or catalog import option. Streaming updates replaces the standard file upload process.
- **[Set Contact Attribute Affinity](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_set_contact_attribute_affinity.htm&release=264.0.0&type=5)**  
    Use Collect Tracking Code to build subscriber affinity models based on contact attributes.
- **[Set User Information and Attributes in Collect Tracking Code](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_set_user_info.htm&release=264.0.0&type=5)**  
    To maintain user details and subscriber information in a contact profile, use the Collect Tracking Code feature in Marketing Cloud Engagement.
- **[Track Category Viewed](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_track_category_view.htm&release=264.0.0&type=5)**  
    Configure Collect Tracking Code to store category data for the product a contact views on your website.
- **[Track In-Site Search](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_track_in_site_search.htm&release=264.0.0&type=5)**  
    Configure Collect Tracking Code to store data about a contact’s search on your website.
- **[Track Items in Cart](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_track_cart.htm&release=264.0.0&type=5)**  
    Configure Collect Tracking Code to track items that are added or removed from a contact’s cart.
- **[Track Page View](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_track_page_view.htm&release=264.0.0&type=5)**  
    The `trackPageView` call is the most common call and can capture three types of information: product or content views, categories views, or search views.
- **[Track Items Viewed](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_track_items_viewed.htm&release=264.0.0&type=5)**  
    Configure Collect Tracking Code to track the items that a contact views on your site.
- **[Track Purchase Details](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_track_conversion.htm&release=264.0.0&type=5)**  
    Configure Collect Tracking Code to store details about a contact’s purchases from your website.
- **[Track User Rating](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_track_rating.htm&release=264.0.0&type=5)**  
    Configure Collect Tracking Code to store contact ratings for items on your website.
- **[Configure trackWishlist for Behavioral Triggers and Collect Tracking Code](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_configure_trackwishlist.htm&release=264.0.0&type=5)**  
    To store customer wishlists for items on your site, set up Collect Tracking Code with trackWishlist. Consult your web developer to configure Collect Tracking Code in Marketing Cloud Engagement.
- **[Third-Party Cookies in Marketing Cloud Engagement](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_partitioned_cookies.htm&release=264.0.0&type=5)**  
    Marketing Cloud Engagement uses third-party cookies to track how users interact with your websites. Most web browsers have discontinued—or are in the process of discontinuing—support for third-party cookies. To ensure that you have access to the same engagement data that you’ve always had, Marketing Cloud Engagement uses partitioned cookies, sometimes known as Cookies Having Independent Partitioned State (CHIPS).

#### See Also

- [Install Collect Tracking Code](https://help.salesforce.com/s/articleView?id=mktg.mc_ctc_install_collect_code.htm&release=264.0.0&type=5 "Learn how to configure your site to use Collect Tracking Code.")