The pixel should be added to the specific page or pages where the desired event occurs. Adding the pixel to a universal element will result in all pages of the website being tracked.
Once the pixel is generated, you can copy or download the code and either manually add it to the website or utilize the tag manager or CMS used to manage the website. Please see below for detailed instructions on both approaches.
Pixel Implementation Instructions
When implementing the Universal Ads pixel on a webpage, it is important to place the pixel code in the correct part of the HTML structure so that it can effectively track user interactions. Here’s a breakdown for placement in either the page head or body:
- If you are able to insert into the page head (between <head> and </head>): Place the UA pixel between the <head> and </head> tags. This ensures that the tracking code loads as the page is being rendered and can track visits immediately. If there is other code already in the <head> section (like meta tags, scripts, or styles), you should place the UA pixel code beneath that existing code, but above the </head> tag.
- If you are unable to insert the pixel into the head then the page body is also an acceptable location (between <body> and </body>): Place the UA tracking pixel between the <body> and </body> tags. Typically, placing it near the beginning of the body tag ensures the tracking code is executed early during the page load.
Tag Manager Implementation (GTM)
If utilizing Google Tag Manager, follow the recommended instructions below.
- Open GTM and click “Add a new tag.”
- Label the tag in the top-left corner.
- Select Tag Configuration and choose Custom HTML.
- Copy the UA pixel JavaScript snippet and paste it into the HTML box.
-
Click the Triggering box to set up the pixel fire logic.
- Choose Page View as the trigger type
- Select Some Page Views as the trigger.
- Set the event trigger conditions to Page URL, equals, and the URL of the page you want to track.