search
Partners Support Log In
Frank Hagan
Updated

Contents

    Back to Top

    Google Analytics Ecommerce Tracking

    About Google Analytics Ecommerce Tracking

    Applies to: ONTRAPORT Plus and above.

    ONTRAPORT can send purchase information from order forms to the Thank You page to record the sales information in Google Analytics Ecommerce Tracking. All ONTRAPORT Order Forms contain an advanced setting to send the information, but an additional script is needed to capture and format it for Google Analytics. Third party applications may include this ability.

    This article demonstrates how to enable sending the information and send it to Google Analytics. It uses a script you can easily edit and insert into your Thank You page's header, or use as a template to create your own. The JavaScript was written by ONTRAPORT QA Engineer Anthony Baldwin and can be used without restriction.

    Here is what you need to get started:

    Configuring Google Analytics

    1. Set up Ecommerce Tracking in Google Analytics using the "Tracking setup (web)" section. Copy and paste the Google Analytics ID number for use in the script later.
    2. Configure Google Analytics for your currency. It defaults to USD / US Dollars. You need to use a recognized currency code for the script, so if you are using a different currency take note of the currency code that Google uses at the bottom of that page. Here are the currency codes used in ONTRAPORT that will work for Google Analytics:
      • USD / US Dollars
      • AUD / Australian Dollars
      • BRL / Brazilian Real
      • CAD / Canadian Dollars
      • CZK / Czech Koruna
      • DKK / Danish Krone
      • EUR / Euro
      • GBP / British Pound Sterling
      • HKD / Hong Kong Dollars
      • HUF / Hungarian Forint
      • ILS / Israeli New Sheqel
      • JPY / Japanese Yen
      • MYR / Malaysian Ringgit
      • MXN / Mexican Peso
      • NZD / New Zealand Dollars
      • NOK / Norwegian Krone
      • PHP / Philippine Peso
      • PLN / Polish Zloty
      • RON / Romanian New Leu
      • SGD / Singapore Dollar
      • SEK / Swedish Krona
      • CHF / Swiss Franc
      • TWD / Taiwan New Dollar
      • THB / Thai Baht
    3. Edit the View Settings in Google Analytics.

    Configuring the Order Form and Thank You Page in ONTRAPORT

    1. Edit the Order Form. Go to the Form Settings. In the Advanced section check the Send Google Ecommerce Tracking Parameters to Landing/Thank you page checkbox. Save the order form.

      Advanced Settings on order forms

      Each submission after making this change will have the Google Ecommerce Tracking Parameters sent to the Thank You page. You do not have to re-embed the form on your webpage.
    2. If you are not using a third party program that parses the information you can use the ONTRAPORT sample script. Obtain the script from GitHub by copying the "minified version" to a text file.
    3. Edit the Google Analytics ID number at the top of the script to your Google ID (obtained in the Configuring Google Analytics section above).
    4. Edit the Google Analytics Currency code if you are not using USD. These values are shown in yellow in the image below.

      Edit the Google Analytics ID and currency code in the script
    5. Copy and paste the edited script in the header section of your order form's Thank You page. For an ONTRApage, click the Settings icon and insert the code into Custom header code in the Custom Code section.

      Insert the edited script into the header section of the thank you page
    6. Save and publish the Thank You page.
    7. Test the script. Note that data is aggregated into Google Analytics after 24 hours. This delay in reporting is not within our control.

    Articles in this section

    Created - Updated
    Have more questions? Submit a request

    Comments