Last active
February 1, 2022 11:01
-
-
Save alewolf/d49a788da470de69dc9c6bc60fbef352 to your computer and use it in GitHub Desktop.
add conversion identifiers to the Google Ads pixel output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Since version 1.8.2 of the plugin. | |
* | |
* This filter will add aditional conversion ID and label pairs to the output | |
* of the Google Ads pixel. | |
* | |
* It will add the output to every page with the Google Ads remarketing pixel, | |
* including the purchase confirmation page. | |
* | |
* Place the following code into your functions.php and replace the placeholders. | |
* | |
* It will only work if the main conversion ID and conversion label are set | |
* within the plugin (which activates the Google Ads conversion tracking in | |
* the first place). | |
*/ | |
add_filter('wpm_google_ads_conversion_identifiers', function ($conversion_identifiers) { | |
$conversion_identifiers['CONVERSION_ID_2'] = 'CONVERSION_LABEL_2'; | |
$conversion_identifiers['CONVERSION_ID_3'] = 'CONVERSION_LABEL_3'; | |
return $conversion_identifiers; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment