The Ontraport tracking script is a small piece of code that lets Ontraport see who's visiting your site and where they came from. For it to work, it needs to be on every page of every website you run. In this lesson, you'll add it in a few minutes.
With the script on your pages, Ontraport can record the UTM values from the links people click, both the first campaign that brought a contact in and the most recent one. You'll find them in the Lead Information section of the contact record. UTM tracking is available on Pro and above.
The script also powers automation. The Contact visits URL trigger and goal react when a contact visits a page on a site outside Ontraport, and they only work if the tracking code is on that page. With tracking in place, you can also add lead score points when someone looks at your pricing page.
How you add the script depends on what your site is built with. There are three cases.
If you build with Ontraport Pages, you're done. The script is installed automatically.
For WordPress, the easiest way is Ontraport's PilotPress plugin. It's available on Plus and above. First, click the profile icon, go to Administration, then Advanced Features, and turn on WordPress. Then go to Administration, then Integrations, then WordPress Website. Click New WordPress Site and choose Existing WordPress Site. Give it a name, enter your site's URL without a slash at the end, and copy the App ID and API Key at the bottom. Then click Save.
Now log in to WordPress as an administrator. Go to Plugins, then Add New, search for PilotPress, click Install Now, and then Activate. When it asks, paste in your Application ID and API Key. PilotPress can do more than tracking, but you can ignore those features for now. On a Basic account, or if you'd rather not use the plugin, use the manual method next.
For any other site builder, click the profile icon, go to Administration, then the Developer Preferences and Resources tab, and click Get Tracking Code. Copy the code.
Paste it into the footer of each page, right before the closing body tag. Most site builders have a site-wide code or footer setting, so you can paste it once and it covers every page. If you use Google Tag Manager, you can add it to every page from there. If you're not sure where custom code goes in your builder, ask that software's support team.
One tip. If your WordPress site uses Cloudflare's Rocket Loader, the script won't work as is. Add data-cfasync equals false right after the opening script tag, like this.
So: Ontraport Pages handle it for you, WordPress uses PilotPress, and every other site gets the code pasted before the closing body tag, on every page. Next up, we'll customize your contact records.