Not every SharpSpring user solely uses the site analytics provided by the application. Very often, users want Google Analytics implemented on their site along with SharpSpring tracking code. With the advent of the Landing Page Builder, those pages hosted in SharpSpring don’t have access to their Google Analytics tracking. In this article, we’ll walk through how to implement GA to your landing pages built in SharpSpring. Also, be sure to check out our blog article Your Definitive Guide to Google Analytics.
Getting the Google Analytics Tracking Code
Step 1: Log in or create a Google Analytics account. In this example, I created a new Account with the Default URL of the subdomain of the site I set up in SharpSpring that was enabled for the Landing Page Builder feature (learn.bryantobin.com). If you already have a Google Analytics account for the root domain of the subdomain you’re using for landing pages in SharpSpring, you can use the tracking code from that account but it will require configuring GA to track subdomains. In general, it’s much easier to declare the subdomain in Google Analytics and get unique tracking code for that subdomain. This article contains more information on Tracking Subdomains in Google Analytics.
Step 2: Under Admin >> Property >> Tracking Info >> Tracking Code, copy the Universal Analytics tracking code for this property.
Adding the Tracking Code to Your Landing Page
Step 1: Log in to SharpSpring and navigate to the Landing Page Builder under Pages >> Landing Pages. Click the pencil of the page you want to track to open the page editor.
Step 2: On the left hand side are a number of editor options. Click the brackets option titled “Edit Code”.
Step 4: Paste the tracking code from Google Analytics here. Delete the opening and closing <script> tags to remove the errors in the code editor. The final tracking code snippet should look like this:
where YOUR-GA-PROPERTY-# would be the numeric Tracking ID string from your Google Analytics dashboard (in the form of UA-XXXXXXXX-X).
Step 5: Click “Save” in the Code Editor.
Step 6: Navigate to “Page Settings” on the left hand side. Scroll down and click on “Publish” to make your changes go live.
(Note: Publishing changes can take a moment. Before testing that data is being pulled through to Google Analytics, allow 10-15 minutes.)
Congratulations! Your landing pages should now be reporting site traffic and analytics to your Google Analytics account.