summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2017-12-12 20:29:44 -0500
committerAnthony G. Basile <blueness@gentoo.org>2017-12-12 20:29:55 -0500
commit73ce9c10188ce4f5014c97ad4c0f8c9f69410113 (patch)
treeac0b7b2f7cb14a145e2308d705033f89cebc736d /plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-options.php
parentUpdate wordpress-mobile-pack 3.2 (diff)
downloadblogs-gentoo-73ce9c10188ce4f5014c97ad4c0f8c9f69410113.tar.gz
blogs-gentoo-73ce9c10188ce4f5014c97ad4c0f8c9f69410113.tar.bz2
blogs-gentoo-73ce9c10188ce4f5014c97ad4c0f8c9f69410113.zip
Update jetpack 5.6
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-options.php')
-rw-r--r--plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-options.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-options.php b/plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-options.php
new file mode 100644
index 00000000..b6e208b7
--- /dev/null
+++ b/plugins/jetpack/modules/google-analytics/classes/wp-google-analytics-options.php
@@ -0,0 +1,70 @@
+<?php
+
+/**
+* Jetpack_Google_Analytics_Options provides a single interface to module options
+*
+* @author allendav
+*/
+
+/**
+* Bail if accessed directly
+*/
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+class Jetpack_Google_Analytics_Options {
+ public static function get_option( $option_name, $default = false ) {
+ $o = get_option( 'jetpack_wga' );
+ return isset( $o[ $option_name ] ) ? $o[ $option_name ] : $default;
+ }
+
+ public static function get_tracking_code() {
+ return self::get_option( 'code', '' );
+ }
+
+ public static function has_tracking_code() {
+ $code = self::get_tracking_code();
+ return ! empty( $code );
+ }
+
+ // Options used by both legacy and universal analytics
+ public static function anonymize_ip_is_enabled() {
+ return self::get_option( 'anonymize_ip' );
+ }
+
+ // eCommerce options used by both legacy and universal analytics
+ public static function track_purchases_is_enabled() {
+ return self::get_option( 'ec_track_purchases' );
+ }
+
+ public static function track_add_to_cart_is_enabled() {
+ return self::get_option( 'ec_track_add_to_cart' );
+ }
+
+ // Enhanced eCommerce options
+ public static function enhanced_ecommerce_tracking_is_enabled() {
+ return self::get_option( 'enh_ec_tracking' );
+ }
+
+ public static function track_remove_from_cart_is_enabled() {
+ return self::get_option( 'enh_ec_track_remove_from_cart' );
+ }
+
+ public static function track_product_impressions_is_enabled() {
+ return self::get_option( 'enh_ec_track_prod_impression' );
+ }
+
+ public static function track_product_clicks_is_enabled() {
+ return self::get_option( 'enh_ec_track_prod_click' );
+ }
+
+ public static function track_product_detail_view_is_enabled() {
+ return self::get_option( 'enh_ec_track_prod_detail_view' );
+ }
+
+ public static function track_checkout_started_is_enabled() {
+ return self::get_option( 'enh_ec_track_checkout_started' );
+ }
+}
+