1 || (PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5)); $sql = array( "DELETE FROM " . TABLE_CONFIGURATION . " WHERE `configuration_key` LIKE '%GOOGLE_ANALYTICS%' OR `configuration_key` LIKE '%GOOGLE_CONVERSION%';", "DELETE FROM " . TABLE_CONFIGURATION_GROUP . " WHERE `configuration_group_title` LIKE '%Google Analytics%';" ); if ($zc150) $sql[] = "DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key = 'configGoogleAnalytics' or page_key = 'configGoogle_Analytics';"; foreach($sql as $query){ $db->Execute($query); } // Step 2: Preliminary DB Setup $configuration = $db->Execute("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title = 'Google Analytics' OR configuration_group_title = 'Simple Google Analytics' OR configuration_group_title = 'Easy Google Analytics';"); if ($configuration->RecordCount() > 0) { while (!$configuration->EOF) { $db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_group_id = " . $configuration->fields['configuration_group_id'] . ";"); $db->Execute("DELETE FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_id = " . $configuration->fields['configuration_group_id'] . ";"); $configuration->MoveNext(); } } $db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_group_id = 0;"); $db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '';"); $db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . " (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (NULL, 'Easy Google Analytics', 'Set Google Analytics Options', '1', '1');"); $configuration_group_id = $db->Insert_ID(); $db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $configuration_group_id . " WHERE configuration_group_id = " . $configuration_group_id . ";"); $insert_order = 1; function InsertConfiguration($title, $key, $value, $desc, $use_function = NULL, $set_function = NULL){ global $configuration_group_id; global $insert_order; global $db; if($use_function == NULL) $use_function = "''"; else $use_function = "'" . $use_function . "'"; if($set_function == NULL) $set_function = "''"; else $set_function = "'" . $set_function . "'"; $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (NULL, '" . $title . "', '" . $key . "', '" . $value . "', '" . $desc . "', $configuration_group_id, $insert_order, NOW(), NOW(), $use_function, $set_function);"); $insert_order++; } // Step 3: Install configuration options InsertConfiguration('Analytics Enabled', 'GOOGLE_ANALYTICS_ENABLED', 'Disabled', 'Enables / disables this plugin.', NULL, 'zen_cfg_select_option(array("Enabled", "Disabled"), '); InsertConfiguration('Plugin Version', 'GOOGLE_ANALYTICS_VERSION', '2.0.0', 'The version of this plugin.', NULL, NULL); InsertConfiguration('Analytics Account', 'GOOGLE_ANALYTICS_UACCT', 'UA-XXXXX-Y', 'This number is the unique ID you were given by Google when you registered for your Google Analytics account. Enter your Google Analytics account number below. (It starts with "UA-")'); InsertConfiguration('Target Address', 'GOOGLE_ANALYTICS_TARGET', 'customers', 'This element is used in conjunction with Google E-Commerce Tracking. It indicates how you want your "transactions" to be identified in your Analytics reports.

Addresses consist of City, State and Country.

This information can help you to determine locality of orders places, shipped to, or billed to. Which address type do you want to use for recording transaction information?

', NULL, 'zen_cfg_select_option(array("customers", "delivery", "billing"), '); InsertConfiguration('Affiliation', 'GOOGLE_ANALYTICS_AFFILIATION', '', 'This optional tracking element is used in conjunction with Google E-Commerce Tracking.

The affiliation tag describes the affiliating store or processing site.

It can be used if you have multiple stores (or web sites) in various locations and is used to track from which location a particular sale originated. If you have one, enter your optional partner or store affiliation in the space provided below.
'); InsertConfiguration('Use SKU code', 'GOOGLE_ANALYTICS_SKU_CODE', 'products_id', 'This tracking element is used in conjunction with Google Analytics E-Commerce tracking.

It enables you to track which products perform better than others using the Product ID, or the Product Model as a unique identifier. Indicate which identifier you want to use to track product performance by selecting one of the options below.', NULL, 'zen_cfg_select_option(array("products_id", "products_model"),'); InsertConfiguration('AdWords Conversion Tracking Active', 'GOOGLE_CONVERSION_ACTIVE', 'No', 'Did you want to activate the conversion tracking?', NULL, 'zen_cfg_select_option(array("Yes", "No"),'); InsertConfiguration('AdWords Conversion Tracking Number', 'GOOGLE_CONVERSION_IDNUM', 'XXXXXXXXXX', 'If you activated Conversion Tracking in the previous section, then you must enter your unique Google Conversion Tracking ID in place of the "XXXXXXXXXXX" shown in the space provided below.

If you have activated Conversion Tracking and you do not enter your number below, tracking will not work. Enter your AdWords Conversion Tracking ID Number below.'); InsertConfiguration('Google AdWords Language', 'GOOGLE_CONVERSION_LANG', 'en_US', 'Select the language to be used. The default is "English US". Select your language below
', NULL, 'zen_cfg_pull_down_google_languages('); InsertConfiguration('Analytics Tracking Type', 'GOOGLE_ANALYTICS_TRACKING_TYPE', 'universal', 'Select the type of tracking you wish to use. The default is the "universal" type. You have the ability to change this to the older "ga.js" method. Select your tracking preference below.
', NULL, 'zen_cfg_select_option(array("universal", "ga.js", "ga.js asynchronous"), '); InsertConfiguration('Custom Tracking JS Enabled', 'GOOGLE_ANALYTICS_CUSTOM_CODE_ENABLED', 'Disable', 'Enables / disables inclusion of custom Javascript.', NULL, 'zen_cfg_select_option(array("Enable", "Disable"), '); InsertConfiguration('Custom Tracking JS', 'GOOGLE_ANALYTICS_CUSTOM_CODE', '', 'If you wish to include any Javascript code after the main tracking segment, insert it here.

', NULL, 'zen_cfg_textarea('); //Step 4: Install language options $db->Execute("DROP TABLE IF EXISTS " . TABLE_GOOGLE_ANALYTICS_LANGUAGES . ";"); $db->Execute("CREATE TABLE " . TABLE_GOOGLE_ANALYTICS_LANGUAGES . " ( languages_id int(11) NOT NULL auto_increment, name varchar(50) NOT NULL default '', code char(10) NOT NULL default '', sort_order int(3) default NULL, PRIMARY KEY (languages_id), KEY idx_languages_name_zen (name) );"); $db->Execute("INSERT INTO " . TABLE_GOOGLE_ANALYTICS_LANGUAGES . " VALUES (NULL,'Chinese (simplified) - ???','zh_CN',1), (NULL,'Chinese (traditional) - ???','zh_TW',2), (NULL,'Danish - Dansk','da',3), (NULL,'Dutch - Nederlands','nl',4), (NULL,'English (Australia)','en_AU',5), (NULL,'English (UK))','en_GB',6), (NULL,'English (US)','en_US',7), (NULL,'Finnish - suomi','fi',8), (NULL,'French - Français','fr',9), (NULL,'German - Deutsch','de',10), (NULL,'Hebrew - ???','iw',11), (NULL,'Italian - Italiano','it',12), (NULL,'Japanese - ???','ja',13), (NULL,'Korean - ???','ko',14), (NULL,'Norwegian - Norsk','no',15), (NULL,'Polish - polski','pl',16), (NULL,'Portuguese (Brazil) - Português (Brasil)','pt_BR',17), (NULL,'Portuguese (Portugal) - Português (Portugal)','pt_PT',18), (NULL,'Russian - ???????','ru',19), (NULL,'Spanish - Español','es',20), (NULL,'Swedish - Svenska','sv',21), (NULL,'Turkish - Türkçe','tr',22);");