Implementing Multiple Account Engagement (Pardot) Tracking Codes on One Website

For businesses that use Account Engagement (Pardot), tracking their website visitor activity is important. Beyond simply capturing the number of visits and unique visitors, the ultimate goal would be to get information on the pages the visitor visits and interacts with, and subsequently, register that information once that visitor turns into a prospect (i.e. converts).

Unfortunately, this becomes a challenge if you have just one website but multiple Account Engagement (Pardot) accounts, because it does not seem possible to have more than one tracking code running at the same time. However, there is a way to inject two or more Pardot tracking codes into a single script, even though this is not presently a standard feature! Here’s how…

Multiple Tracking Codes, One Website

The two key issues at play here are:

  1. The official documentation on implementing tracking codes to track visitor and prospect activity only covers implementing one code per webpage.
  2. It is known Javascript behaviour that when two working tracking codes are put together, it seems to trigger a script conflict because of the duplication in variables, functions, or event-handler access, causing one or both scripts to become invalid.

For more context, see this post on the IdeaExchange requesting the feature become available to all Account Engagement (Pardot) customers.The only way to do this would be to use a custom script where the different tracking code scripts are consolidated into a single script to mitigate the possibility of the scripts becoming inoperable.

Note: The solution below builds on an original solution shared by Chris Heiden back in 2015, with updates to account for first-party tracking and changes in the default tracking code provided by Account Engagement.

1. Create Tracker Domains For Your Different Accounts

Firstly, you will need to create unique tracker domains that match your website’s domain for each Account Engagement (Pardot) account that you have. This is because each tracker domain can only be validated once, so they cannot be used in more than one account.

Note: Ensure that these subdomains you create are only used as Account Engagement tracker domains.

For example, if The DRIP had three different Pardot accounts, we could consider using the following tracker domains:

  • us.thedrip.tech
  • europe.thedrip.tech
  • asia.thedrip.tech

Alternatively, we could also just slightly modify the tracker domain:

  • go1.thedrip.tech
  • go2.thedrip.tech
  • go3.thedrip.tech



READ MORE:
Introduction to Pardot Tracker Domains and Vanity URLs

2. Get the Ids From Each Account and Default Campaign

Next, you will need to get the different Pardot Account Ids (piAId), Pardot Campaign Ids (piCid), and Pardot Tracker Domains (piHostnames), to prepare the final script you will implement on your web page.

To do this, you will need to go to Account Engagement Settings → Domain Management → Tracking Code Generator. You will need the details in the highlighted section below for each of the Pardot accounts you are dealing with for your business.

Note: If your piCid is blank, choose a campaign in the Override Default Campaign section and the tracking code will be refreshed accordingly.

3. Modify the Javascript Code and Implement It

Lastly, you will need to consolidate the different Ids and tracker domains into a single script. This will ensure that each time your web page and the script load, it will call out to the multiple Ids correctly.

Here is an example of what the script will look like:

piAId = '123456';
piCId = '56789';
piHostname = ''go1.thedrip.tech”;
piTracker();
 
piAId = '234567';
piCId = '67890';
piHostname = ''go2.thedrip.tech”;
piTracker();

Then, you can go forth and implement this modified code on your web pages.

Note: The function piTracker(), which is loaded in the default tracking code, is responsible for sending page visits to Account Engagement. Be sure to leave it in the code!




READ MORE:
Add the Pardot Tracking Code to Your Website (Account Engagement Visitor Reports)

Potential Risks

As with any custom solution or workaround, there are a few risks, outlined below:

1. You Will Not Be Able to Get Account Engagement (Pardot) Support

If you plan to implement this on your own, you risk not being able to get any support from the Pardot Support Team, as this custom code is considered out of scope.

Screenshot from a case I submitted when trying to implement this solution previously.

2. It May Not Work With Google Tag Manager

If you use Google Tag Manager, changing the standard tracking code provided by Account Engagement (Pardot) may render the code “invalid” in Google Tag Manager because there are duplicate piAIds and piCIds in the custom solution outlined above. You may need to implement the script directly on the web page to ensure that it runs as expected, if you are not able to get past Google Tag Manager’s error messages.

See here for the official documentation on Using Google Tag Manager with Account Engagement.

Summary

If your company has multiple Account Engagement (Pardot) accounts, you may need to implement multiple Pardot Tracking Codes into a single website to facilitate the tracking of your website visitors. While it may seem like a big effort, it is justified considering how beneficial and crucial website tracking is to the business. Hopefully now you will be able to achieve this!

 


 

This Pardot article written by: 

Salesforce Ben | The Drip

Lucy Mazalon is the Head Editor & Operations Director at Salesforceben.com, Founder of THE DRIP and Salesforce Marketing Champion 2020.

Original Pardot Article: https://www.salesforceben.com/the-drip/implementing-multiple-account-engagement-pardot-tracking-codes-on-one-website/

Find more great Pardot articles at www.salesforceben.com/the-drip/

Pardot Experts Blog

We have categorized all the different Pardot articles by topics.

Pardot Topic Categories

More Pardot Articles

See all posts

 


 

This Pardot article written by: 

Salesforce Ben | The Drip

Lucy Mazalon is the Head Editor & Operations Director at Salesforceben.com, Founder of THE DRIP and Salesforce Marketing Champion 2020.

Original Pardot Article: https://www.salesforceben.com/the-drip/implementing-multiple-account-engagement-pardot-tracking-codes-on-one-website/

Find more great Pardot articles at www.salesforceben.com/the-drip/