I have some code that let's you send an email once an item is back in stock. The email pulls the product link via a parameter %product_link% but I want to append to the end of the product link some UTM parameters so I am able to track visits from this link in GA.
Can someone help me on how I go about doing this?
The bit of code specific to the email is as follows:
// Options - Message
if ( get_option('Product_stock_option_message') ) {
$options_message = get_option('Product_stock_option_message');
} else {
$options_message = 'Hello, The product %product_name% is in stock. You can purchase it here: %product_link%';
}
$options_message = str_replace('%product_name%', $prod_title, $options_message);
$options_message = str_replace('%product_link%', $prod_link, $options_message);