惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Last Watchdog
The Last Watchdog
博客园_首页
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
美团技术团队
小众软件
小众软件
V
V2EX
博客园 - Franky
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Attack and Defense Labs
Attack and Defense Labs
S
Security Affairs
Simon Willison's Weblog
Simon Willison's Weblog
I
Intezer
T
The Exploit Database - CXSecurity.com
有赞技术团队
有赞技术团队
S
Schneier on Security
人人都是产品经理
人人都是产品经理
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
K
Kaspersky official blog
PCI Perspectives
PCI Perspectives
AI
AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
罗磊的独立博客
O
OpenAI News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Register - Security
The Register - Security
V
Vulnerabilities – Threatpost
GbyAI
GbyAI
博客园 - 【当耐特】
C
Cisco Blogs
大猫的无限游戏
大猫的无限游戏
Help Net Security
Help Net Security
Google DeepMind News
Google DeepMind News
S
Securelist
Application and Cybersecurity Blog
Application and Cybersecurity Blog
P
Proofpoint News Feed
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
L
LangChain Blog
SecWiki News
SecWiki News
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V2EX - 技术
V2EX - 技术
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
L
LINUX DO - 热门话题
Cisco Talos Blog
Cisco Talos Blog

Blog of Simple Analytics

The EU wants to kill cookie banners Google is tracking you (even when you use DuckDuckGo) German court rules Meta’s tracking tech violates GDPR Closing the data gap - Simple Analytics x Usercentrics The EU-US data deal may be dead in the water You are missing 20% of your website data with GA4 How a reverse trial will push Simple Analytics to the next level Google will start tracking all your devices (WTF?) Big Tech Fails EU’s Digital Services Act: Only Wikipedia Passes the Test Meta fined $102 million by the Irish Data Protection Commission Europeans spend 575 Million hours per year clicking cookie banners The most interesting GDPR fines GDPR and fines: all there is to know Google loses key antitrust case Web Analytics for Crypto Companies Web analytics for publishers Google pulls Uno Reverse card: Rolls back decision to kill third-party cookies Privacy Monthly July 2024 Privacy Perspectives June 2024 Privacy Monthly June APRA fumbles targeted advertising Privacy Monthly May Meta loses key privacy battle Google delays cookie phase-out once again Privacy Monthly April 2024 Web Analytics and Consent Cookies 101 Privacy Monthly March 2024 German authority cracks down on cookie banners Google Tag Manager vs Google Analytics Google search alternative Data retention in Google Analytics Guide to Google Analytics and Cookie consent What are Google Analytics' identifiers? How to export data from Google Analytics Privacy Monthly February 2024 The Criteo case: a big deal for Big Tech Privacy Monthy January 2024 What the Digital Markets Act means for privacy Google Settles in $5B Incognito Mode Lawsuit Legal troubles for Adobe Analytics Web analytics for nonprofits HIPAA and mental health Why Meta subscriptions are under attack, and why it matters for privacy Privacy Monthly: December Simple Analytics AI Host analytics on Cloudflare Zaraz Add Google Analytics to Convertkit Google Analytics Pricing - Paid vs Free Road to 1 Million ARR - October update CCPA and Data Protection: all there is to know Analytics without a cookie banner Enterprise Analytics Privacy Monthly: November 2023 Delete Act: all you need to know Mobile App Tracking Under Fire The road to 1 Million ARR - September Update Privacy Monthly: October 2023 HIPAA violations First challenge to the EU-US data transfer framework Direct Marketing under GDPR Road to 1 million ARR - August Update CCPA vs CPRA: what is new? Privacy Monthly: September 2023 A/B Testing with Simple Analytics Dobbs v. Jackson ruling is a privacy mess Privacy Monthly: August 2023 What are your rights under the CCPA? When does the CCPA apply? How does the HIPAA compare to the CCPA and GDPR? Why Meta is in a world of trouble CJEU: cookie-based analytics collects sensitive data Road to 1 million ARR - July update All about the new Data Transfer Framework Road to 1 Million ARR - June update What is PHI under HIPAA? Sweden declares Google Analytics illegal Searching for GA4 Alternatives? Top 10 Reliable Options for Google Analyticss Ultimate HIPAA Compliance Checklist: Essential Steps for Healthcare Providers Privacy Monthly: June 2023 More troubles for Google Analytics The path to 1M ARR - May Update Data Processing Agreements Minimal Product Analytics Facebook data transfers declared illegal Is Google Analytics CCPA-compliant? Help us with your input Cookie banners: How to stay GDPR compliant? GDPR Compliance Checklist Privacy Monthly: May 2023 Simple Analytics: Privacy-first website analytics Improve your e-commerce performance with analytics European Facebook blackout is closer than we think Know your website’s Carbon Emissions - and how to reduce it The path to 1M ARR - April 2023 How to add video tracking using Google Tag Manager? Why is my Simple Analytics data different from Google Analytics? Debug Simple Analytics script How to Import Google Analytics Data to Simple Analytics
How to track form submissions using Google Tag Manager?
Iron Brands · 2023-04-24 · via Blog of Simple Analytics

This documentation page will guide you through tracking form submissions on your website using Simple Analytics and Google Tag Manager.

The process involves creating custom events within Google Tag Manager, which then sends the data to Simple Analytics. This is particularly useful when you want to monitor how many users submit forms on your site and gather insights into user behavior.

First, we have created a test website for demonstration purposes, which includes a simple form containing an email address field and a submit button.

events-gtm-testwebsite.png

You want to track how often users click the submit button and see the corresponding data in Simple Analytics.

To achieve this in Google Tag Manager, follow the steps below:

  1. Open Google Tag Manager and make sure you're in the appropriate workspace.
  2. Navigate to the "Tags" section. If you haven't already installed the Simple Analytics tag, do so now.
  3. Create a new tag and select "Custom HTML."
  4. Enter the following code snippet in HTML.
<script>
if (window.sa_event) {
  sa_event("form_submit");
}
<script>

This code checks if Simple Analytics is loaded and sends a "form_submit" event to Simple Analytics when the form is submitted.

Next, scroll down and open de “Advanced Settings” section.

  1. In the "Advanced Settings" section, configure Google Tag Manager to fire this tag after the Simple Analytics tag. Like this:

events-gtm-fire.png

  1. Name the tag "Form Submissions" and select "Simple Analytics" from your existing tags.
  2. Close "Advanced Settings" and set up a trigger for the form submit event.
  3. Click the "+" button to create a new trigger named "Form Submit Trigger".

event-gtm-tag.png

  1. Find and select "Form Submission" from the list, then save the trigger.
  2. Link the trigger to the custom HTML code you created earlier.
  3. Save and submit the changes in Google Tag Manager.

After refreshing your test website and submitting the form, you can check the Simple Analytics Events Explorer to see if the "form_submit" event has been recorded.

events-gtm-dashbaord.png

You can also view the page where the event occurred, such as the home page, and any additional information you've added.

To further enhance your form tracking capabilities, you can utilize data points from the data layer within Google Tag Manager. Follow these steps to configure built-in form variables and use them in your Google Analytics tag:

  1. In Google Tag Manager, go to "Variables" and configure the built-in variables by scrolling down and selecting the appropriate form variables.

events-gtm-form-classes-etc.png

  1. With these variables available, navigate to "Tags" and open the "Form Submissions" tag.
  2. To use the form classes variable as metadata, add a new curly bracket object within the code snippet. Type "form classes" followed by double quotes, and the form classes variable should appear as an option.

events-gtm-form-calsses.png

  1. By selecting "form classes," you instruct the script to send the form classes data from your website as metadata to Simple Analytics.
  2. You can use other variables, such as "ID" or "target" depending on your website's requirements. In this example, we'll focus on form classes.
  3. To verify the form classes data, inspect the form element on your test website. The form should display the class attribute with the specified class name.
  4. Return to Google Tag Manager, save the changes, and publish your updates.
  5. Refresh your example website, submit the form, and check Simple Analytics for the recorded "form_submit" event and the associated form class metadata.

events-gtm-form-classes-dashboard.png

By incorporating form variables and metadata into your tracking strategy, you can effectively monitor form performance on your website and optimize the user experience.