To install the UA pixel via Google Tag Manager we recommend utilizing the Universal Ads Pixel GTM Template directly within your Google Tag Manager account.
- Open Google Tag Manager
- Select “Templates” and “Search Gallery” under “Tag Templates”
3. Search and select the Universal Ads Pixel template from the GTM Community Template Gallery
4. Select “Add to workspace”
5. Navigate to the “Tags” tab on the left navigation panel
6. Click “New”
7. In the top right corner, rename Untitled Tag to your Universal Ads Pixel Name
8. Click the “Tag Configuration” box
9. In the top right corner select the magnifying glass and type Universal Ads Pixel
10. Enter the “Pixel ID” and “Access Token” into their respective fields
11. Select event type and parameters (optional) you’d like collected on the event
12. Click anywhere in the Triggering box.
13. Specify the action(s) you’d like to trigger the tag.
14. Click Save in the top right corner and publish your tag.
You can also manually install your Universal Ads Pixel through GTM by following the following steps:
Manual Base Pixel Code 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 All Page Views as the trigger.
- Click Save in the top right corner.
Manual Event-level Code Tag Manager Implementation (GTM)
Setting up event tracking in GTM is very similar to the base code set up, but instead of using the base code, you will use the event-level code generated in UA. You will also configure the trigger to fire on specific events (i.e. purchase confirmation page, purchase button click, etc.) as opposed to all page views.
- 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 event-level code JavaScript snippet and paste it into the HTML box
- Click the Triggering box to set up the pixel fire logic
- Select a trigger type
- Configure the trigger to only fire when certain conditions are met
- Click “Save” in the top right corner.
This code will call the window.uapx.sendConversion() function with the event name and optional parameters tracked on the event.