Skip to content

Commit

Permalink
Feature: Add Google Analytic 4 tracking on v3 forms (#66)
Browse files Browse the repository at this point in the history
* Feature: record page views on load with ga4

* feature: hook into v3 enqueuescript

* feature: check if sscript should be included

* doc: add unreleased tags

* feature:encode tracking id

* refactor: wip include begin_checkout + view_item events

* feature: add remaining items

* refactor: update selectors

* doc: update tag description

* fix: add page title to config

* chore: remove comment and quotations

* fix: remove extra categories test

* feature: enable debug mode:

* refactor: replace submit event listener with form submission event

* refactor: remove original script addition

* feature: add analytics as a field

* refactor: return early, extract gtags

* chore: remove test innerhtml

* refactor: initialize variable first

* refactor: include visual components for the block editor

* fix: remove build dir. Include build in .gitignore.

* refactor: remove all logic related to block and form builder

* feature: directly add field without the use of a block.

* refactor: handling of whether to continue to include script has been moved out js and included while determining to add the field to the form.

* feature: hook into givewp_donation_form_schema.

* fix: doc tags, canPrintscripts
  • Loading branch information
JoshuaHungDinh authored Aug 16, 2023
1 parent ab7f166 commit ca4d8d7
Show file tree
Hide file tree
Showing 15 changed files with 43,358 additions and 20,336 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ node_modules

vendor

# Assets
assets/dist
build

languages/*
!languages/.gitkeep
Expand Down
4 changes: 3 additions & 1 deletion give-google-analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

use GiveGoogleAnalytics\Donations\ServiceProvider;
use GiveGoogleAnalytics\FormExtension\ServiceProvider as FormExtensionServiceProvider;

if ( ! defined( 'ABSPATH' ) ) {
exit;
Expand Down Expand Up @@ -344,7 +345,8 @@ function Give_Google_Analytics() {
// Check Give min required version.
if (Give_Google_Analytics()->get_environment_warning()) {
$service_providers = [
ServiceProvider::class
ServiceProvider::class,
FormExtensionServiceProvider::class
];

foreach ($service_providers as $service_provider) {
Expand Down
Loading

0 comments on commit ca4d8d7

Please sign in to comment.