1. Home
  2. AccessAlly
  3. Metrics in AccessAlly
  4. Google Analytics (GA4) Purchase Tracking for AccessAlly

Google Analytics (GA4) Purchase Tracking for AccessAlly

If you’re using AccessAlly order forms, you can take advantage of the built-in Metrics dashboard… but you might also want to pull the sales data into your existing Google 4 account.

Enable Google Analytics Ecommerce Tracking

The first step is to create a new property using your site URL.

Create a Property in Google Analytics

Select the options that are the best match for your business details.

Describe Business details

Select your desired business objectives.

Select Business objectives

Select web (or skip for now if you’d like to review.)

Web or Skip

Add your site to both the website and stream name spots.

Data Stream setup

Click the view tag instruction button.

View Tag Instructions

And select install manually and copy the code.

Install manually

Add tracking code to the header of your site.

If you’re not familiar with this option or your theme doesn’t have a space to include it you can download the free WPCode plugin.

WPCode

Add in the header code section.

Add header code in WPCode

Add the Debugger for Google Analytics 4 Extension to Chrome this will show you if your header code is working.

Debugger Extension

Now visit a page on your site and click the GA4 button. A message will appear letting you know this page is using GA4.

GA4 Success

You can also see your views being tracked in Google Analytics.

Views Being Tracked

Add AccessAlly GA4 Code to Header

Now it’s time to add the AccessAlly order form tracking script to the header section of your site. You can add this below the previous code.

Click here to download the code as a .txt file.

Using the WPCode plugin (or adding to header) place this code below the previous code added at the start of this article.

Paste AccessAlly G4 Script

Create a Thank You Page

Make a new page (in an offering as shown below) or create a page in WordPress. Copy the link to your thank you page.

Create a Thank You page in AccessAlly

Review Order Form(s)

AccessAlly → Sales → Order Form Setup → search for the order form you’d like to track.

Note the order form number and name.

Order Form ID number and name in AccessAlly

Create Thank You Page Tracking Link

At the end of the thank you page URL add the code below with your order form ID number and order form name.

/?item=##&product_name=Order_Form_Name_Goes_Here_Payment

Example below.

https://kim1.accessallydev.com/thank-you/?item=1&product_name=Amazing_Course_Payment_Plan

Select “What to show on successful payment”

  • Show templated success message – if you want to allow password creation at time of purchase
  • Redirect to a Thank You page

Order Form ID number and name in AccessAlly

Show Templated Success Message

With this option, you will need to add the event data to success area message with HTML selected so that it counts the e-commerce event as soon as the purchase has been made.

Screenshot of Order Form Success Message option

Once that’s selected, you will need to add in the information as javascript that you would like to capture. Here is an example:

<script>
  gtag("event", "purchase", {
    currency: "USD",
    value: 99,
    items: [
    {
      item_id: "1",
      item_name: "Name of Your Course",
      price: 99,
      quantity: 1
    }
   ]
  });
</script>

In the example above, the Item ID should correspond to your Order Form ID. You can also add additional values, if needed. Here is the documentation from Google for that.

Redirect to a Thank You page

Add your coded link as the thank you page URL and check the box to append order form info.

Thank You page link in AccessAlly

Make a Purchase

Place a purchase from your order form and you will see your tracking info added.

Thank you tracking code success

View in GA4 after successful purchase event is tracked.

  1. Tracked thank you page visit.
  2. Tracked purchase event from your order form.

G4 Tracking Success

Updated on July 30, 2024
Was this article helpful?

Related Articles

NO QUESTION GOES UNANSWERED

Live Weekly Q&A

Join us for live Q&A. Learn the basics, discover what's possible, and connect with AccessAlly users.

Need Support?

Have questions? Get in touch. Our inbox support hours are 9am-5pm EST, Monday - Friday.

Laptop with the AccessAlly demo site

AccessAlly is the most flexible way to sell and elegantly deliver digital offerings. All in one place.

WATCH THE DEMO

You'll get follow-up emails about AccessAlly and new features. Opt out anytime. Full privacy policy here.