-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGoogleTagManager.php
More file actions
executable file
·50 lines (44 loc) · 2.26 KB
/
GoogleTagManager.php
File metadata and controls
executable file
·50 lines (44 loc) · 2.26 KB
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
50
<?php
/*************************************************************************************/
/* This file is part of the GoogleTagManager package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace GoogleTagManager;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use ShortCode\ShortCode;
use Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator;
use Thelia\Module\BaseModule;
class GoogleTagManager extends BaseModule
{
/** @var string */
public const DOMAIN_NAME = 'googletagmanager';
public const GOOGLE_TAG_MANAGER_GMT_ID_CONFIG_KEY = 'googletagmanager_gtmId';
public const GOOGLE_TAG_VIEW_ITEM = 'google_tag_view_item';
public const GOOGLE_TAG_VIEW_LIST_ITEM = 'google_tag_view_list_item';
public const GOOGLE_TAG_TRIGGER_LOGIN = 'google_tag_trigger_login';
/**
* @throws PropelException
*/
public function postActivation(ConnectionInterface $con = null): void
{
ShortCode::createNewShortCodeIfNotExist(self::GOOGLE_TAG_VIEW_LIST_ITEM, self::GOOGLE_TAG_VIEW_LIST_ITEM);
ShortCode::createNewShortCodeIfNotExist(self::GOOGLE_TAG_VIEW_ITEM, self::GOOGLE_TAG_VIEW_ITEM);
}
/**
* Defines how services are loaded in your modules.
*/
public static function configureServices(ServicesConfigurator $servicesConfigurator): void
{
$servicesConfigurator->load(self::getModuleCode().'\\', __DIR__)
->exclude([THELIA_MODULE_DIR . ucfirst(self::getModuleCode()). "/I18n/*"])
->autowire()
->autoconfigure();
}
}