Analytics::update_pixel_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_pixel_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::FACEBOOK_PIXEL_NAME ) {
				$account['code']    = $new_value;
				$account['enabled'] = ! empty( $new_value );
				$this->api->update_analytics_settings( $account['id'], $account );

				return;
			}
		}
	}

User Contributed Notes

You must log in before being able to contribute a note or feedback.