Install Pixel Manually

Step-by-step guide on how to implement the web engagement pixel to your website’s code if you’re not using a tag manager or integration.

We recommend that you install pixels through Google Tag Manager or Shopify, if applicable. The manual installation method should only be used if you do not use Google Tag Manager or do not have a Shopify store.

Install the Base Pixel Code

The GroundTruth Pixel’s base code automatically tracks standard engagement events such as pageview, scroll, and click. No additional configuration is needed to capture these. If you wish to measure additional events (e.g. add to cart, purchase), continue to instructions for Setting Up Custom Events.

  1. Copy the code snippet below

    <script>
        window.GTPX_DEBUG = true; 
        (function(w, d, s, u, o, q, j) {
            w[o] = w[o] || function() {
                (w[o].q = w[o].q || []).push(arguments);
            };
            j = d.createElement(s); j.async = true; j.src = u;
            d.getElementsByTagName('head')[0].appendChild(j);
        })(window, document, "script", "https://gt-pixel-prod.groundtruth.com/pixel.v1.js", "gtpx");
    </script>
  2. Paste the code snippet into the HTML on every website page where you want tracking, preferably in the header (<head>)
  3. Confirm that the pixel is firing on all site pages where you want tracking using the validation steps

 If you wish to measure additional events, continue onto “Setting Up Custom Events."

Setting Up Custom Events

In addition to standard engagement events, the GroundTruth Pixel supports capturing add-to-cart, purchase, and conversion events through additional custom coding. Your web developer will need to add a small line of code that acts as a signal for each custom event:

Add-to-cart

<script>
  //Track add-to-cart
  gtpx("cart",{value: XXXXX});
</script>

Purchase

<script>
  //Track completed purchase
  gtpx("purchase",{value: XXXXX});
</script>

Conversion (e.g., Form Fill):

<script>
  //Track completed conversion
  gtpx("conversion",{label: "XXXXX"});
</script>

Replace XXXXX with the appropriate variable.

Variables may vary from site to site, so please consult your developer to know those of your website. Note: Keep the Conversion value within the double quotes "" to indicate a string value. The Add to Cart and Purchase values are numerical float values that do not require any quotes.

When a user completes one of these actions, that code calls a function (gtpx("<event>", {})) which tells our system to record the event. When placed in the appropriate location(s) (e.g., when a user clicks the “add to cart” button, on the final order confirmation page after a user completes a transaction), you receive more specific data than just knowing if someone clicked an ad.

About Manual Installation

This method hardcodes the pixel directly in the website. However, it may get confusing to manage if you have many pages on your website or if you have many tags added to your coding. If this is the case, it’s recommended to use Google Tag Manager (GTM) which allows you to centrally manage all tags.


Frequently Asked Questions

  1. How do I generate the pixel? You don’t. The GT Pixel is a universal code snippet, ready to be copied and placed on any website. No unique generation is required.
  2. Where does the pixel need to be placed? On every page of the website to ensure it captures a comprehensive view of the user journey.

  3. Do I need to remove the existing conversion pixel if I want to add a web engagement pixel? No, both pixels can exist on the same page. They track different goals and have separate reporting, so they will not interfere with each other.

  4. If I’m setting up a custom conversion event (e.g., form fill), where do I place the custom code? Place the custom event code only on page that confirms the conversion. For example, to track a form fill, you would place the code on the post-submission “Thank You” page. 

  5. My ad's clickthrough URL links to my site, but a 3rd-party site (like an ordering platform) handles the final conversion. What should I do? If your ad sends a user to YourSite.com first, and then your site redirects them to 3rdPartySite.com to complete the action, the tracking data will not get pass along. The 3rd-party site never receives the tracking code, so it has no way of knowing that user came from your ad. Our suggested solution is to direct traffic directly to the final conversion domain (e.g., the 3rd-party ordering page), which will skip the redirect and ensure the tracking codes are received and reporting more accurately.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.