Open fungc-io opened 2 years ago
Updated draft (not shaped, still a few research need to be done)
Portal Design can be found here: https://www.figma.com/file/swXJYkdXuPsLyA5q0aHu1r/Authgear-UI---Fung?node-id=10%3A445
Nav item "Integration" will be between "User Profile" and "Billing"
@louischan-oursky The tracking across domain feature is described here: https://support.google.com/tagmanager/answer/6164469?hl=en
Our integration with Google Tag Manager is declarative. The primary button on each page has data-authgear-event
attribute. The value are listed in the following list.
authgear.button.change_password
authgear.button.change_additional_password
authgear.button.create_password
authgear.button.change_login_id
authgear.button.remove_login_id
authgear.button.resend_oob_otp
authgear.button.enter_oob_otp
authgear.button.enter_password
authgear.button.enter_recovery_code
authgear.button.enter_totp
authgear.button.send_reset_password_code
authgear.button.sign_in
authgear.button.sign_up
authgear.button.sign_out
authgear.button.oauth
authgear.button.reset_password
authgear.button.continue_with_current_account
authgear.button.use_another_account
authgear.button.remove_biometric
authgear.button.schedule_account_deletion
authgear.button.connect_oauth
authgear.button.disconnect_oauth
authgear.button.resend_verification_code
authgear.button.update_profile
authgear.button.regenerate_recovery_code
authgear.button.download_recovery_code
authgear.button.remove_totp
authgear.button.remove_oob_otp
authgear.button.setup_oob_otp
authgear.button.setup_totp
authgear.button.enter_verification_code
authgear.button.revoke_session
authgear.button.revoke_session_group
authgear.button.revoke_all_sessions
To integrate, the developer should follow these steps.
gtm.element.dataset.authgearEvent
.gtm.element.dataset.authgearEvent
variable. Set the trigger to be the trigger we created above.That link is for Universal Analytics. It seems that the latest version of GA is 4. I couldn't find the equivalent for version 4. This is how I add additional domains though.
I was testing the setup and found that the "Sign in with Google" do not trigger the Tag for "authgear.button.oauth"
GTM Variables when Sign in with email, tag was fired
GTM Variables when Sign in with Google, tag was not fired
Integration method was the same as commented by @louischan-oursky https://github.com/authgear/authgear-server/issues/1747#issuecomment-1073446229
The solution is to create the form submission trigger to capture this "click". The form submission trigger has an option to wait for GTM to fire the event before submitting the form. However, I cannot figure out why GTM in this particular case mistakenly detects this as a regular click instead of a form submission.
Message
Add Google Tag Manager to Authgear. GTM is a free tool to add tracking on a website with little coding.
Background
We would like to track the channel source of our signups in the Authgear marketing site. Currently the link click to the sign up page is tracked. However we lose track after that. This is a pain point experienced by other developers as well. It will be great if we can add native GTM integration to Authgear for other creators too. In addition, this is a popular integration among SaaS, it is the most common way to add tracking to an application.
Goal and Objectives
For Example:
List of events:
User flow
To properly set the GTM event into GA or other analytics platform like Facebook events manager. They should read the docs, which will include steps like in this article Remind the user to set up cross domain tracking to measure the number accurately.
Design: https://www.figma.com/file/swXJYkdXuPsLyA5q0aHu1r/Authgear-UI---Fung?node-id=10%3A445
Appetite
2 weeks
Reference
Ref: https://support.google.com/tagmanager/answer/7679219?hl=en Ref: https://developers.google.com/tag-platform/tag-manager/web/datalayer Ref: https://support.google.com/tagmanager/answer/6164469?hl=en
View the comment below for Technical Problems and alternative approach.