| @@ 18-23 (lines=6) @@ | ||
| 15 | } |
|
| 16 | ||
| 17 | class Jetpack_Google_Analytics_Legacy { |
|
| 18 | public function __construct() { |
|
| 19 | add_filter( 'jetpack_wga_classic_custom_vars', array( $this, 'jetpack_wga_classic_anonymize_ip' ) ); |
|
| 20 | add_filter( 'jetpack_wga_classic_custom_vars', array( $this, 'jetpack_wga_classic_track_purchases' ) ); |
|
| 21 | add_action( 'wp_footer', array( $this, 'insert_code' ) ); |
|
| 22 | add_action( 'wp_footer', array( $this, 'jetpack_wga_classic_track_add_to_cart' ) ); |
|
| 23 | } |
|
| 24 | ||
| 25 | /** |
|
| 26 | * Used to generate a tracking URL |
|
| @@ 18-37 (lines=20) @@ | ||
| 15 | } |
|
| 16 | ||
| 17 | class Jetpack_Google_Analytics_Universal { |
|
| 18 | public function __construct() { |
|
| 19 | add_filter( 'jetpack_wga_universal_commands', array( $this, 'maybe_anonymize_ip' ) ); |
|
| 20 | add_filter( 'jetpack_wga_universal_commands', array( $this, 'maybe_track_purchases' ) ); |
|
| 21 | ||
| 22 | add_action( 'wp_head', array( $this, 'wp_head' ), 999999 ); |
|
| 23 | ||
| 24 | //TODO add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'add_to_cart' ) ); |
|
| 25 | //TODO add_action( 'wp_footer', array( $this, 'loop_add_to_cart' ) ); |
|
| 26 | //TODO add_action( 'woocommerce_after_cart', array( $this, 'remove_from_cart' ) ); |
|
| 27 | //TODO add_action( 'woocommerce_after_mini_cart', array( $this, 'remove_from_cart' ) ); |
|
| 28 | ||
| 29 | //TODO add_filter( 'woocommerce_cart_item_remove_link', array( $this, 'remove_from_cart_attributes' ), 10, 2 ); |
|
| 30 | ||
| 31 | //TODO add_action( 'woocommerce_after_shop_loop_item', array( $this, 'listing_impression' ) ); |
|
| 32 | //TODO add_action( 'woocommerce_after_shop_loop_item', array( $this, 'listing_click' ) ); |
|
| 33 | //TODO add_action( 'woocommerce_after_single_product', array( $this, 'product_detail' ) ); |
|
| 34 | //TODO add_action( 'woocommerce_after_checkout_form', array( $this, 'checkout_process' ) ); |
|
| 35 | ||
| 36 | add_action( 'wp_footer', array( $this, 'wp_footer' ) ); |
|
| 37 | } |
|
| 38 | ||
| 39 | public function wp_head() { |
|
| 40 | $tracking_code = Jetpack_Google_Analytics_Options::get_tracking_code(); |
|