Analytics::update_google_option( string $old_value, string $new_value )
Summary
No summary available.Parameters
- $old_value
-
(string) (Required)
- $new_value
-
(string) (Required)
Return
(void)
Source
File: src/BigCommerce/Settings/Sections/Analytics.php
public function update_google_option( $old_value, $new_value ) { if ( $old_value == $new_value || ! get_option( self::SYNC_ANALYTICS, 1 ) ) { return; } $settings = $this->api->get_analytics_settings(); foreach ( $settings as &$account ) { if ( $account['name'] == self::GOOGLE_ANALYTICS_NAME ) { if ( strpos( $account['code'], 'script' ) === false ) { $account['code'] = $new_value; $account['enabled'] = ! empty( $new_value ); $this->api->update_analytics_settings( $account['id'], $account ); } return; } } }