What are Tracking Scripts?
Applies to: All ONTRAPORT accounts.
The ONTRAPORT Tracking Script allows you to see what web pages a contact has visited. Tracking page visits can be used with Campaigns in Triggers, Goals and in legacy Rules.
After adding tracking scripts to your web pages, you’re able to view each visit by a contact in their Contact Log.
NOTE: WordPress sites using the PilotPress plugin have tracking built in already!
How to Set Up Page Tracking
- Go to Administration > Developer Preferences and Resources > Get Tracking Code
- Click Get Tracking Code and copy it to your clipboard (CTRL+C)
- Paste the code on all the pages of your domain you wish to track. Content Management Systems (CMS) may allow you to paste the code into a theme, template or header file so it is auto-generated with each page. Wordpress sites integrated with ONTRAPORT with the PilotPress plugin are tracked automatically and do not need this additional code.
Using Page Tracking in Campaigns
- Triggers: You can specify that a Trigger adds a Contact to the Campaign when they visit a tracked page by selecting Contact Visits URL:
- Goals: You can set a web page visit as a Goal, using the same Contact Visits URL configuration. You can have the Goal apply only to people upstream of the Goal on the Campaign, to anyone anywhere on the Campaign, or have the Goal add them to the Campaign where the Goal is located no matter if they are on the Campaign Map or not.
- Using Wildcards in the 'Contact Visits URL' Trigger: You can create Triggers or Goals that fire when a contact visits any page in a domain by using the base URL with an ending slash and asterisk. For example "https://ontraport.com/*" would allow the Trigger or Goal to fire when the home page, or any other page on that domain, is visited.
Creating Legacy Rules - not recommended
Rules are a legacy feature in ONTRAPORT Pro and above accounts. They are a more complex way of automating responses to a page visit. Rules also have a trigger Visits URL. Rules require that your automation steps are spread out among several different areas of ONTRAPORT and are therefore more complicated to maintain end modify later. To learn more about legacy Rules visit our Legacy Rules pages.
Using Wildcards in the 'Contact Visits URL' Trigger
You can create Rules using the trigger mentioned above that fire when a contact visits any URL of a particular domain you own. For example, if I install a tracking script on several pages, and I want the Rule to fire regardless of which particular page on that domain a contact visits, I can add an asterisk after the domain in the Rule trigger field.
Wildcards on names and folders of your URL work on triggers as well. This makes it possible for you to use wildcards like https://www.ontraport.com/product* or https://www.ontraport.com/products/* to broaden your trigger criteria.
We recommend using page tracking with Campaigns, as it is easier to configure and manage the Triggers or Goals later.
Other Important Facts
- If you want to track a specific WordPress page that is NOT integrated with ONTRAPORT, add Tracking Scripts to it by following the instructions above.
- RocketLoader / RocketScript, a popular feature found in the Cloudflare plugin for WordPress, breaks our tracking script. To correct it, add data-cfasync="false" right after the opening <script tag in the tracking script as shown in red: