Implement Q Pixel with Google Tag Manager
  • 01 Jul 2024
  • 3 Minutes to read
  • Contributors
  • Dark
    Light

Implement Q Pixel with Google Tag Manager

  • Dark
    Light

Article summary

Quantcast is fully integrated with Google Tag Manager. Installing your tag is now easier than ever.


đź’ˇ Reminder:

  • Do not alter the code. Any edits to the code may result in the tag not firing.

  • The tag does not interfere with your page load because it is asynchronous (it loads in the background). See Get Started with Quantcast Tagging for more technical details.  

⚠️ What you need to continue:

Q Pixel (tag code available in the Quantcast Platform on the Q Pixel page)

Set up the Q Pixel Base Tag

  1. Create a new tag using the Custom HTML tag type

  2. Paste your base tag into the HTML input box

  3. Add a Page View trigger for All Page

Set up Q Pixel Event Tags

This example sets up tracking of the Purchase Completed page which exists at /purchase-completed.

 Create a new tag

  1. Paste the event tag in the HTML input box

  2. Add a Page View trigger for the path of the page you want to track with this event
    This should be your result:


3. Publish your workspace changes.

Quantcast Advertise Tag Integration

You may notice that Google Tag Manager offers a built-in integration for the “Quantcast Advertise” tag type. You may use this integration and input your p-code to enable the tag, but please be aware that this is a legacy pixel and integration that will be replaced in the future.

Setting up an Event Tag with Data Passback

Data Passback can be used to populate dynamic values within a tag. For example, the revenue amount or order ID of a particular purchase can be included as a value in the tag. 

For data passback to function, there may be changes that will need to be made both on the website by a developer outside of Google Tag Manager and within Google Tag Manager. This process makes use of Google’s data layer. 

Please refer to the Adding Variables for Data Passback section in this guide for instructions on setting up variables.

Implementing Data Passback to a Q Pixel Event (Full Tag)

Using the Full Tag is preferred unless the Q Pixel is already firing on the event page. If so, please skip to the Partial Tag instructions below.

  1. Replace the placeholders in the Full Tag with their respective GTM variables.

  1. Add a new “Custom HTML” tag and paste the Full Tag into the HTML field.

Note: Variables will vary from one account to another. Please check with your Web Dev team to select the correct variables.

  1. Select the corresponding trigger. In this example, the tag should fire on the Purchase Confirmation page.

4. Save the tag and navigate back to the Tags tab.

  1. Select the Q Pixel tag implemented across all pages.

  2. Add an exception to the current trigger for the page that the new tag was implemented on. 

  • In this example, we're adding Purchase Confirmation:

7. Publish all changes

Once implemented, please contact your Quantcast team to confirm the tag is working properly.

Implementing Data Passback to a Q Pixel Event (Partial Tag)

A Partial Tag is used when the Q Pixel has already been installed on the event page.

  1. Replace the placeholders in the Partial Tag with their respective GTM variables.

  1. Add a new “Custom HTML” tag and paste the Partial Tag into the HTML field.

Note: Variables will vary from one account to another. Please check with your Web Dev team to select the correct variables.

  1. Select the corresponding trigger, in this example, the tag should fire on the Purchase Confirmation page.

  1. Save the tag and publish all changes

Once implemented, please contact your Quantcast team to confirm the tag is working properly.

Adding Variables for Data Passback

There are various ways to generate data on the page.  Below is the most common via a data layer.

  1. Update your page code to capture the data you want to collect in the data layer (e.g., order ID, revenue, customer type, etc).  Additional instructions on the implementation of the data layer can be found here. The code would look something like this:

window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  '0rderid': 'orderid_Value1',
  'Variable_Name2': 'Variable_Value2',
  'Variable_Name3': 'Variable_Value3'
});
  1. Indicate to GTM the location of the data. In this example, we will set up orderid. Click Variables from the GTM menu.

  1. Click New under User-Defined Variables to open the setup menu.

  1. Click Untitled Variable and name your variable.

  2. Click the Variable Configuration area.

  1. Select the method that GTM will look for data passback. We will select Data Layer Variable from the menu for this example.

  1. Add the Data Layer Variable name in the field. We are using orderid as this is the name of the variable in the data layer. Your Data Layer Variable name may be different. Leave all other settings as-is.

8. Click Save on the upper right corner once this is complete.

Repeat the steps above to add additional variables. Once your User Defined Variables are set up, they will be visible on the menu. After you've created the variables, return to the Conversion Tag setup to complete the implementation.

If you have any questions, please contact [email protected].

Additional Information on Tagging


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