impress-org/give-google-analytics

Add a check for give_category and if present send it in the addItem command

Benunc opened this issue · 1 comments

If the donation was to a form that has a give_category set, we should add that to the data we send to Google.

Would be great to have it fall back to something instructional if give_category is not enabled. Maybe we could have an admin message that links to our category/tag article with something like

We noticed you don't have Give Categories enabled. To send a category to Google Analytics, enable Give categories and tags. For more on this feature, see this tutorial.

Todo:

  • modify the code to send the category, and fall back to 'none' if disabled
  • at activation, display an admin message for users without Give categories enabled.

After researching it appears that there can only be one category per transaction. In Give's case, many users are not using the category taxonomy for their forms. If the category is excluded from the GA ecommerce tracking beacon then it gets lumped into the "(not set)" category. As well, if multiple categories are included they get lumped into a single category in analytics. The "/" delimiter is meant to signify hierarchy, rather than sibling categories. Give's categories are not hierarchical, therefore it starts breaking down in Google Analytics.

The road that I've taken and seems to make the most sense here to me is to simply use "Donations" as the category for all transactions. I have also included an option for the admin to customize this category. This makes sense because it's easy for admins to view just donations if a website is running ecommerce via Woo and is also tracking orders in GA alongside donations.

2017-03-08_11-26-14

2017-03-08_11-30-47