Implementing Quantcast Measure on Shopify
  • 03 Dec 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Implementing Quantcast Measure on Shopify

  • Dark
    Light

Article summary

Implementing Quantcast Measure on your Shopify is simple and easy.

  1. Login to Shopify and select Settings > Customer Events in the left menu of the admin section.
  2. Click Add Custom Pixel.
  3. Enter a name for the pixel.
  4. Copy the code below and paste it into the Shopify code box.

Code:

<!-- Quantcast Shopify Pixel Code -->
// Load Quantcast SDK
const script = document.createElement('script');
script.src = "https://secure.quantserve.com/quant.js";
script.async = true; script.type = "text/javascript";
document.head.appendChild(script);

// Initialize Quantcast
window._qevents = window._qevents || [];

// Subscribe to Shopify events
analytics.subscribe("page_viewed", (event)=>{
  window._qevents.push({ 
    "qacct": "p-*************",
    "source": "shfy",
    "labels": "_fp.event.PageView,_fp.event." + event.context.document.title",
    "event": "refresh"
  });
});
analytics.subscribe("product_added_to_cart", (event)=>{
  window._qevents.push({ 
    "qacct": "p-*************",
    "source": "shfy",
    "labels": "_fp.event.AddToCart",
    "event": "refresh"
  });
});
analytics.subscribe("checkout_completed", (event) => {
  window._qevents.push({
    "qacct": "p-*************",
    "source": "shfy",
    "labels": "_fp.event.Purchase Confirmation",
    "orderid": event.data?.checkout?.order?.id,
    "revenue": event.data?.checkout?.totalPrice?.amount,
    "event": "refresh" 
  });
});
<!-- End Quantcast Shopify Pixel Code -->
  1. Make sure to update the placeholder in the "qacct" field to reflect your Quantcast P-Code.
  2. Click Save > Connect Pixel

Please refer to Shopify’s Standard Events page for additional information.For a resource on building Shopify themes, see Shopify's Cheat Sheet.

Verify tag implementation using the Quantcast Tag Inspector

The Quantcast Tag Inspector is a Google Chrome plugin that checks whether your Quantcast Tag and Audience Segments are implemented correctly. Install the Inspector to review your site's individual pages and ensure the audience segments are firing correctly. For more information, see the Inspect Your Tag help document. You are done! Please check the Q Pixel app to confirm your tags collect data. If you do not see any activity, contact [email protected] or submit a Help Center request at www.quantcast.com.  For more information on tagging, see our Tagging Overview article.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Q, facilitating knowledge discovery through conversational intelligence