Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tracking for the contact form block (#13688)
* Add tracking for the contact form * Add file * Make it possible to track contact form submissions only coming from Gutenberg blocks * update event name * escape data sent to tracks * add a jetpack prefix to the tracks event function * add new file to the phpcs whitelist * fix undefined index error * fix undefined index error * dont send tracks events in development mode * use a different tracks implementation on wpcom * move wpcom tracking to a different file * Simplify approach to one single function - keep that function in a file that is already synchronized with WordPress.com - include both wpcom and Jetpack tracking approaches in that function. - remove the dev mode check since this will be addressed in #13711 * Send blog ID in recorded event when available * Feedback ID can include letters as well. Let's not sanitize as int * Specify a user when submission is anonymous * Use a different prefix for WordPress.com and Jetpack If we don't do that we can't separate the 2 when looking at the data later on. * Add missing comment * * Switch to using record_user_event See https://github.com/Automattic/jetpack/pull/13688/files#r339803539 Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>
- Loading branch information