Home / Widgets / Change Purchase Event to Subscribe
Duplicate Snippet

Embed Snippet on Your Site

Change Purchase Event to Subscribe

When using the WPCode Conversion Pixels addon you can filter the event names used for reporting to the Pixel integrations. In this case, we are changing the default Purchase event used for the Facebook Pixel to the "Subscribe" standard event https://developers.facebook.com/docs/meta-pixel/reference#standard-events

<10
Code Preview
php
<?php
add_filter( 'wpcode_pixel_event_name_facebook', function ( $event_name, $event_key ) {
	if ( 'purchase' === $event_key ) {
		return 'Subscribe';
	}
	return $event_name;
}, 10, 2 );

Comments

Add a Comment