woocommerce / facebook-for-woocommerce

A first-party extension plugin built for WooCommerce. Development is managed by Ventures.
https://woocommerce.com/products/facebook/
GNU General Public License v2.0
211 stars 138 forks source link

Invalid Match Key Parameters for events #1777

Open jconroy opened 3 years ago

jconroy commented 3 years ago

Creating a catch-all issue for reports of "Invalid Match Key Parameters" for AddToCart and ViewContent Events. We are investigating more but the advice to date has been

“​… this problem seems to affect only ip_address and user_agent parameters for two specific events. As we’re not seeing this issue widespread across the platform and this problem is affecting only a small amount of events from this Pixel, the problem may be due to users having ad-ons to their browser to avoid submitting information to websites. I recommend reviewing Pixel Settings and the code on the website itself to check for any issue. If there are no issues in the parameters requested on the website and the code is correct, please run a test using the test event tool. The admins may go ahead and click Mark as Resolved to see if the issue persists.”

Some initial problem-solving steps

Reports

fylgjur commented 3 years ago

Reported in 3905075-zen

AashikP commented 3 years ago

Another report in https://wordpress.org/support/topic/server-sending-invalid-match-key-parameters-for-addtocart-event-30/

AashikP commented 3 years ago

Another report in 3928113-zen

jessLundie commented 3 years ago

Another report in https://wordpress.org/support/topic/server-sending-invalid-match-key-parameters-for-viewcategory-event-8/

solstudioim commented 3 years ago

Another report: https://wordpress.org/support/topic/pixel-error/?view=all

thuautp commented 3 years ago

Another report in the forum: https://wordpress.org/support/topic/server-sending-invalid-match-key-parameters-for-viewcontent-event-16/

WillBrubaker commented 3 years ago

3998501-zen

solstudioim commented 3 years ago

Reported as well in the forum: https://wordpress.org/support/topic/events-issues/?view=all

solstudioim commented 3 years ago

Another report: https://wordpress.org/support/topic/server-sending-invalid-match-key-parameters-7/?view=all

shohanhossainnab commented 3 years ago

Another report: https://wordpress.org/support/topic/3-errors-in-pixel-diagnostics/

shohanhossainnab commented 3 years ago

Another report: https://wordpress.org/support/topic/pixel-server-events-capi/#post-14746145

rashedripon commented 3 years ago

Reported here as well: https://wordpress.org/support/topic/server-sending-invalid-match-key-parameters-for-viewcategory-event/page/3/#post-14769227

stephhjacq commented 3 years ago

Another report: https://wordpress.org/support/topic/invalid-key-parameter/

thuautp commented 3 years ago

Reported in 4250327-zen

foosantos commented 3 years ago

Another report: https://wordpress.org/support/topic/michal-golan-jewelry-requested-help-fixing-a-facebook-pixel/

brianyu28 commented 3 years ago

Another report: 31471768-hc

fevered commented 3 years ago

Another report here: https://wordpress.org/support/topic/server-sending-invalid-match-key-parameters-for-viewcontent-event-19/

xpurichan commented 2 years ago

Received a new report for this today.

amElnagdy commented 2 years ago

Another report 4640197-zen

kaushikasomaiya commented 2 years ago

Reported in 4749302-zen

Some additional details:

Additionally, they got this error: Invalid Match Key Parameters for events (https://i.imgur.com/4zufspM.png)

thisissandip commented 2 years ago

4825367-zen

NathalyaVides commented 2 years ago

Another report here https://wordpress.org/support/topic/invalid-ip_address-parameters-for-viewcontent/

NathalyaVides commented 2 years ago

New report here https://wordpress.org/support/topic/server-sending-invalid-match-key-parameters-for-addtocart-event-34/

pehaa commented 2 years ago

Another report 5190044-zd-woothemes

EjayhanFernandes commented 2 years ago

Another report 29300512-hc

fvdbgit commented 2 years ago

I have the same issue

tavo94 commented 2 years ago

I have these two problems

Server Sending Invalid Match Key Parameters for AddToCart Event Server Sending Invalid Match Key Parameters for ViewContent Event

rawdreeg commented 2 years ago

Thanks, @fvdbgit, @tavo94,

The Invalid Match Key Parameters for events error can be triggered for different reasons. Identifying a root cause has been quite tricky. One hypothesis is that the events are triggered by a web crawler, not a real user. We're still investigating a solution. We'll be sure to update this thread as soon as we have a fix available.

Babylon1999 commented 1 year ago

Similar issue here: https://wordpress.org/support/topic/server-sending-invalid-match-key-parameters-for-viewcategory-event-14/#post-16189618

zd-5704308

WillBrubaker commented 1 year ago

From ticket 5885876-zen

I have altered the code in fbutils.php around line 92 and the products are now showing up In facebook without the joined SKU_ID

This code is your original file fbutils.php

$fb_retailer_id = $woo_product->get_sku() ?

                                                       $woo_product->get_sku() . '_' . $woo_id :

                                                       self::FB_RETAILER_ID_PREFIX . $woo_id;

and was showing as the link - c4Xylm.png

I have changed to

$fb_retailer_id = $woo_product->get_sku() ?

                                                       $woo_product->get_sku() :

                                                       self::FB_RETAILER_ID_PREFIX . $woo_id;

it is now showing as required - xKDAw0.png

Products are syncing to facebook and no errors showing in status logs, can this be investigated and if working correctly from your testing be published

rawdreeg commented 1 year ago

Thanks, @WillBrubaker. I will discuss this with the team and provide updates.

PS: This is something Meta has been looking into as well.

Millby-furniture commented 1 year ago

From ticket 5885876-zen

I have altered the code in fbutils.php around line 92 and the products are now showing up In facebook without the joined SKU_ID

This code is your original file fbutils.php

$fb_retailer_id = $woo_product->get_sku() ?

                                                       $woo_product->get_sku() . '_' . $woo_id :

                                                       self::FB_RETAILER_ID_PREFIX . $woo_id;

and was showing as the link - c4Xylm.png

I have changed to

$fb_retailer_id = $woo_product->get_sku() ?

                                                       $woo_product->get_sku() :

                                                       self::FB_RETAILER_ID_PREFIX . $woo_id;

it is now showing as required - xKDAw0.png

Products are syncing to facebook and no errors showing in status logs, can this be investigated and if working correctly from your testing be published

I sent this to woocommerce support a couple of days ago I have been running this code for the last 4 or 5 days without issue and zero issues against the cataloque in facebook or in Millby Furniture hopefully this can be checked by others and implemented so I dont have to change the code everytime there is an update.

rawdreeg commented 1 year ago

Thanks, @Millby-furniture.

One thing to note: The wc_facebook_fb_retailer_id was introduced in v 2.6.12. This filter can be used to modify the FB retailer id if needed.

You can do so as follow:

add_filter( 'wc_facebook_fb_retailer_id', 'fb_id_filter', 10, 2 );

function fb_id_filter( $fb_retailer_id, $woo_product ) {
    return (string) $woo_product->get_id();
}

This should help modify the value of the FB retailer id. As for whether we need to modify the default, I reckon that may require further discussion.

Millby-furniture commented 1 year ago

@rawdreeg @WillBrubaker whats happening? seen a couple of updates have gone out but not the above I have to keep changing your code back to what I posted above, surely 2 years is long enough to resolve the issue

rawdreeg commented 1 year ago

Thanks @Millby-furniture,

We must be careful with every change we make to a function, as users may have implemented customizations based on a particular behavior.

Until we release a fix for this, I suggest you use the wc_facebook_fb_retailer_id to modify the fb_retailer_id. You can use it as follow:

add_filter( 'wc_facebook_fb_retailer_id', 'fb_id_filter', 10, 2 );

function fb_id_filter( $fb_retailer_id, $woo_product ) {
    return (string) $woo_product-> get_sku();
}