-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgtm-ecommerce-woo.php
49 lines (39 loc) · 1.69 KB
/
gtm-ecommerce-woo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Plugin Name: Tag Pilot FREE - Google Tag Manager Integration for WooCommerce
* Plugin URI: https://wordpress.org/plugins/gtm-ecommerce-woo
* Description: Complete Google Tag Manager plugin for WooCommerce, Consent Mode v2 and Server-Side GTM ready. Ready GTM configuration for GA4 and Facebook Pixel. Built-in product feed for Google Merchant Center.
* Version: 1.12.3
* Author: Tag Concierge
* Author URI: https://tagconcierge.com/
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: gtm-ecommerce-woo
* Domain Path: /languages
*
* WC requires at least: 4.0
* WC tested up to: 9.4.2
*/
namespace GtmEcommerceWoo;
require __DIR__ . '/vendor/autoload.php';
use Automattic\WooCommerce\Utilities\FeaturesUtil;
use GtmEcommerceWoo\Lib\Container;
$pluginData = get_file_data(__FILE__, array('Version' => 'Version'), false);
$pluginVersion = $pluginData['Version'];
add_action( 'before_woocommerce_init', function() {
if ( class_exists( FeaturesUtil::class ) ) {
FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
});
add_action('plugins_loaded', function () use ( $pluginVersion) {
$container = new Container($pluginVersion);
$container->getSettingsService()->initialize();
$container->getGtmSnippetService()->initialize();
$container->getEventStrategiesService()->initialize();
$container->getEventInspectorService()->initialize();
$container->getProductFeedService()->initialize();
$container->getOrderMonitorService()->initialize();
$pluginService = $container->getPluginService();
$pluginService->initialize();
register_activation_hook( __FILE__, [$pluginService, 'activationHook'] );
});