How to Add Collect Tracking Code For Product Views In Marketing Cloud

In the realm of e-commerce, understanding how customers interact with your products is invaluable. Salesforce Marketing Cloud Collect empowers you to track and analyze these interactions, providing insights that can shape your marketing strategy. In this example, we’ll walk you through the process of adding Collect tracking code for product views to your website, referencing Salesforce’s official documentation:

Salesforce Marketing Cloud Collect Tracking Code – Track Page Views

Step 1: Retrieve Marketing Cloud Collect Tracking Code

Follow the instructions provided in the official documentation to retrieve the Marketing Cloud Collect tracking code specific to tracking page views.

Step 2: Insert Tracking Code into Your Website

  1. Access Your Website’s HTML/CMS: Log in to your website’s platform or content management system where you can edit the website’s code.
  2. Insert Tracking Code for Product Views: Identify the appropriate section in the HTML, usually within the <head> tags. Paste the tracking code obtained from Marketing Cloud Collect. This code snippet is designed to capture data related to page views.
  3. <!-- Marketing Cloud Collect Tracking Code for Page Views --> <script> _etmc.push(["setOrgId", "YOUR_ORG_ID"]); _etmc.push(["setUserInfo", {"email": "user@email.com"}]); _etmc.push(["trackPageView"]); </script>
  4. Replace “YOUR_ORG_ID” with your actual Marketing Cloud Organization ID. Ensure that this code is included on all pages where you want to track product views.

Step 3: Customize Tracking for Product Views

  1. Identify Product View Events: Determine the events on your website that constitute a product view. This might include clicking on a product image, visiting a product detail page, or any other relevant actions.
  2. Enhance Tracking Code for Product Views: Modify the tracking code to include specific events related to product views. For example, if clicking on a product image triggers a product view, your code could look like this:
  3. Copy code<!-- Marketing Cloud Collect Tracking Code for Product Views --> <script> _etmc.push(["setOrgId", "YOUR_ORG_ID"]); _etmc.push(["setUserInfo", {"email": "user@email.com"}]); _etmc.push(["trackPageView", {"item": "Product123"}]); </script>
  4. In this example, replace “Product123” with a dynamic identifier for the viewed product.

Step 4: Test the Implementation

  1. Use Marketing Cloud Analytics: Log in to Marketing Cloud and navigate to Analytics. Monitor real-time data to confirm that page views and product view events are being tracked.
  2. Perform Product View Tests: Act as a user on your website and perform actions that trigger product views. Verify that Marketing Cloud Collect accurately captures these events.

Step 5: Analyze Product View Data in Marketing Cloud

  1. Access Marketing Cloud: Log in to your Salesforce Marketing Cloud account and navigate to the Collect dashboard.
  2. Explore Product View Data: Analyze the data related to product views. Gain insights into which products are capturing the most attention, how users navigate through your site, and other valuable information.

Conclusion: Elevating Product-Centric Insights

By following this example and referencing Salesforce’s official documentation, you’ve successfully added Collect tracking code for product views to your website. The data collected will empower you to tailor your marketing strategies to customer behaviors, ultimately enhancing the user experience and driving better results in your e-commerce endeavors. Regularly assess and optimize your tracking setup to align with evolving business objectives and customer preferences. With Marketing Cloud Collect, you’re well-equipped to navigate the dynamic landscape of e-commerce.