Loading

Using Google Tag Manager with Account Engagement

Data pubblicazione: Sep 30, 2025
Descrizione
You can use Google Tag Manager with your Account Engagement tracking code. Google Tag Manager does not affect Account Engagement tracking, provided that you set your filters to allow the Account Engagement tracking code to fire on the pages you wish to track with Account Engagement. You simply need to create a tag in Google Tag Manager that contains your Account Engagement tracking code.

NOTE:
- These instructions assume that you are familiar with Google Tag Manager. In order to follow these instructions, you must already have an Account Engagement campaign, a Google Tag Manager account and container set up, and have properly placed your Google Tag Manager code on the pages you wish to track. See Google's Tag Manager documentation for help with getting started. This is a custom process in Account Engagement and, as such, Account Engagement Support will be unable to help troubleshoot these instructions.
- Account Engagement and Google Tag Manager will work with both Google Analytics 4 and Universal Analytics.
Risoluzione
Follow these steps to create a tag for your Account Engagement tracking code. 
 

In Account Engagement


1. In pi.pardot.com, Navigate to Marketing > Campaigns. In Lightning, browse to the Account Engagement Campaigns tab.
2. Select the campaign you wish to use with Google Tag Manager.
3. Click View Tracking Code, and copy the tracking code.
4. Edit the code. You’ll use the edited code in Google Tag Manager. 
- Remove the lines that begin with:
if(window.attachEvent) { ... }
else { ... }

- Replace them with:
async_load();

Note: 

Ensure no other conditional operators exist on the async_load function. 

In Google Tag Manager

1. Navigate to the Account and Container you would like to create the tag in.
2. Navigate to Tags and click New.
3. Click Custom HTML Tag.
4. Paste your previously copied Account Engagement tracking code in the Configure Tag box.
5. Click Continue.
6. Configure how you'd like the triggers to fire. For more on this step, refer to Google's documentation.
7. Click Create Tag.
8. Rename the tag. We suggest something like "Account Engagement Tracking Code-[name of your campaign]".
9. Click Save.
10. Click Publish when you're done editing tags in your container.
 

Example Resultant Tracking Code After Changes:

<script type="text/javascript">
  piAId = '000000'; // Replace with piAId from your tracking code
  piCId = '0000'; // Replace with piCId from your tracking code
  piHostname = 'pi.pardot.com'; // Replace with piHostname from your tracking code
  (function() {
    function async_load(){
      var s = document.createElement('script'); s.type = 'text/javascript';
      s.src = ('https:' == document.location.protocol ? 'https://pi' : 'http://cdn') + '.pardot.com/pd.js';
      var c = document.getElementsByTagName('script')[0]; c.parentNode.insertBefore(s, c);
    }
    async_load();
  })();
</script>
Numero articolo Knowledge

000381476

 
Caricamento
Salesforce Help | Article