woocommerce/pinterest-for-woocommerce

Pinterest Tag tracking can be enabled even if Tag ID is not part of Commerce Integration with Pinterest.

message-dimke opened this issue · 0 comments

Describe the bug:

One can enable Pinterest Tag tracking even if the Tag ID is missing.

Steps to reproduce:

  1. Install Pinterest for WooCommerce plugin, which implements Pinterest v5 API.
  2. Initiate the Connect Wizard and skip Tag creation/selection during connection.
Cursor_and_Pinterest
  1. Check the Settings tab. Observe Track conversions setting is Off.
Settings_‹_Pinterest_‹_Marketing_‹_WooCommerce_‹_WordPress_Pinterest_—_WooCommerce
  1. Check database wp_options values for keys names pinterest_for_woocommerce and pinterest_for_woocommerce_data. Look for tag_id substring and observe empty values for:
  • tracking_tag inside pinterest_for_woocommerce key is empty;
  • tag_id inside pinterest_for_woocommerce_data key is empty;
  • connected_tag_id inside pinterest_for_woocommerce_data key is empty;
  1. Go to the Settings tab and enable Track conversions setting.
  2. Go to the Connection tab.
Connection_‹_Pinterest_‹_Marketing_‹_WooCommerce_‹_WordPress_Pinterest_—_WooCommerce
  1. Observe Track conversions with Pinterest Tag settings block at the bottom. See there is a Tag selected.
  2. Hit Save changes button.
  3. Check database wp_options values for keys names pinterest_for_woocommerce and pinterest_for_woocommerce_data. Look for tag_id substring and observe for:
  • tracking_tag inside pinterest_for_woocommerce key got the value;
  • tag_id inside pinterest_for_woocommerce_data key remained empty;
  • connected_tag_id inside pinterest_for_woocommerce_data key remained empty;
  1. Go to website frontend and observe Pinterest Tag events get fired with you navigate Shop pages or perform a Checkout.

NOTE: Track conversions with Pinterest Tag is an active block. If the application detects no Tag exists, it will automatically create it. Not all the values for options are going to be updated. The application is using tracking_tag from pinterest_for_woocommerce key value for Tag ID and saving Tag settings from the Connection tab will fill in that value.

NOTE: Also, when at the Settings tab, Enhanced Match support and Automatic Enhanced Match support are Tag related. However they are initialized with On values if Tag was not selected.

Expected behavior:

If Tag ID is empty or Pinterest commerce integration does not have it set, do not allow Tracking and Enhanced match settings to be changed. Do not allow Pinterest Tag events to be fired from the frontend if Tag is not a part of Commerce Integration with Pinterest.