Events and Goals in Google Analytics
Updated: Jul 22, 2020
Usually, when we wish to track a goal for a form fill-out, we use a destination goal type. In this way, once the lead has filled out the form and landed on the thank you page URL, it can be tracked.
However, in some cases, once the form has been filled, the lead is not taken to a different URL, and receives a thank you message on the same page.
Recently we were asked by one of our clients whether we can help him track leads filling a form when the thank you notice is displayed on the same URL.
The client uses a marketing automation system that doesn’t support a clear different TYP.
We searched but couldn’t find a solution, but eventually were able to figure out how to do it, and decided to make it available to our blog readers as well.
Here is a step-by-step guide to add the event tracking code to your site:
Setup a new EVENT goal on Google Analytics
Navigate to your goals:
2. Click Admin, at the bottom left, below the list of reports in the report navigation, and navigate to the desired view (Analytics lets you have multiple accounts. Each account can have multiple properties, and each property can have many views)
3. In the VIEW column, click Goals.
4. Click + NEW GOAL to create a new goal. Note: If + NEW GOAL is not visible, this means you have already created the maximum of 20 goals for the current view.
5. Give your goal a name.
6. Select Event from the list of options.
7. Click Continue to set up your goal details.
8. Set the event conditions. An Event has the following components: Category, Action, Label (optional, but recommended), Value (optional). For each component (at least for the first two) you need to add value, and these values will display in your reports. You can read more about events here. For our customer we added:
9. Turn the Use the Event value as the Goal Value toggle to Yes and click Save
Goals can NOT be deleted. Because goal conversions are calculated and applied as your data is processed, it is not possible to delete a goal. If one of your goals becomes obsolete or irrelevant, turn off recording instead. This can be done by changing the recording status to OFF.
10. All is left for you to do is adding the relevant code to your thank-you page note. Remember that the event script should be running as part of the thank you note.
The code should be added as shown here. Make sure to change the Tracking ID (UA code) to your own. The code can be found by going to: Admin -> Tracking Info -> Tracking Code -> Tracking ID. In this example you can see that the Event Conditions we chose to use in the Goal details, are used here in the script ( ‘event’, ‘Form’, ‘Fill_Out’, ‘Scan_to_SAP’), you will need to change it to the one you set.
For our client who was using the marketing automation system, we pasted the code in Conversion Code Head (the addition is in bold below), while the regular Analytics code is located in Tracking Code Head in all the relevant pages.