Skip to content

Instantly share code, notes, and snippets.

@alewolf
Last active February 1, 2022 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alewolf/d49a788da470de69dc9c6bc60fbef352 to your computer and use it in GitHub Desktop.
Save alewolf/d49a788da470de69dc9c6bc60fbef352 to your computer and use it in GitHub Desktop.
add conversion identifiers to the Google Ads pixel output
<?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