Implement Q Pixel in Shopify
  • 27 Sep 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Implement Q Pixel in Shopify

  • Dark
    Light

Article summary

Implementing Quantcast Measure on your Shopify is simple and easy.

  1. Login, and select Online Store from the navigation bar.

  1. On the top right corner, click on the 3 dots, and select Manage App.

  1. Navigate to Customer Events, click on “Add Custom Pixel”, and give it a descriptive name.

  1. Copy the code below and paste it into the Code box. Make sure to update the placeholder in the "qacct" field to reflect your Quantcast P-Code.


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-*************",
    "labels": "_fp.event.PageView",
    "event": "refresh"
  });
});
analytics.subscribe("checkout_completed", (event) => {
  window._qevents.push({
    "qacct": "p-*************",
    "labels": "_fp.event.Purchase Confirmation",
    "orderid": event.data?.checkout?.order?.id,
    "revenue": event.data?.checkout?.totalPrice?.amount,
    "event": "refresh" 
  });
});


  1. The end result should look something like this:

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 that your tags are collecting 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