woocommerce / pinterest-for-woocommerce

A native Pinterest integration for WooCommerce. Development is managed by Ventures.
https://woo.com/products/pinterest-for-woocommerce/
GNU General Public License v3.0
22 stars 9 forks source link

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

Open message-dimke opened 2 months ago

message-dimke commented 2 months ago

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:
  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:
  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.