woocommerce / pinterest-for-woocommerce

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

Remove CAPI tracker by Pinterest request. #1026

Closed message-dimke closed 3 months ago

message-dimke commented 3 months ago

Changes proposed in this Pull Request:

Disabling Conversion API tracker according to some temporary legal aspects from Pinterest.

How to test.

  1. Install Pinterest extension.
  2. Following the Connect Wizard, set up conversion tracking.
Pinterest
  1. Setting up conversion tracking will send the extension corresponding boolean flags to indicate Pinterest Tag tracking and Conversions API tracking must be enabled.
  2. Check pinterest_for_woocommerce option inside wp_options database table.
  3. The option must include s:22:"track_conversions_capi";b:0; serialized data.
  4. The above will indicate the despite Pinterest is sending us Conversions API is ON, we force it OFF into options. e.g. s:17:"track_conversions";b:1;s:22:"track_conversions_capi";b:0;: Pinterest Tag on ON, but Conversions API is OFF.

Changelog entry

Update - Disabling CAPI tracker.

message-dimke commented 3 months ago

We should do it via a separate setting for CAPI. We should make the capi tracker option false. No UI for it would mean that we don't have to do anything else for now.

When connecting to Pinterest, Pinterest replies back with a set of features and their corresponding statuses. The set looks like this:

tags => bool
CAPI => bool
catalog => bool

The three flags above indicate what was chosen during the onboarding wizard (a Pinterest-hosted wizard). For example, choosing to sync catalog will send the catalog flag set to true.

The problem is tracking. Pinterest has a single wizard screen for tracking and a single yes/no button that turns ON/OFF both tags and CAPI flags synchronously. So, without forcing CAPI tracking to false, we can not disable that type of tracking.

Introducing the new track_conversions_capi setting will default to false for all the existing plugin users, but for the new ones, it will be set to the value selected while onboarding. Taking this into account, I will force the setting to false when the new user is connecting, no matter what the wizard returns to us.

Does it make sense?

budzanowski commented 3 months ago

I will force the setting to false when the new user is connecting, no matter what the wizard returns to us.

For now this is good enough. We can change it later when they will have separate consents.

budzanowski commented 3 months ago

Looks good. Do we need to add plugin update procedure that sets CAPI tracking to false explicitly? Or not set will default to false?

message-dimke commented 3 months ago

If the setting is empty or there is no such setting, it will resolve to false.

https://github.com/woocommerce/pinterest-for-woocommerce/blob/c85534a9f5d6f4f76fe673de2ffef84ba98999ab/class-pinterest-for-woocommerce.php#L557-L562

If I read it correct =) Anyway, I have unit tests that should test this as well.