Title: Dynamic variable
Last modified: February 24, 2019

---

# Dynamic variable

 *  [kilenearth](https://wordpress.org/support/users/kilenearth/)
 * (@kilenearth)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/dynamic-variable/)
 * When we try to “ADD NEW TRACKING” or create “NEW CUSTOM AUDIENCE”, we are normally
   required to fill in the field with the text we want in “Pass Advanced Data” area.
 * In which, in “Pass Advanced Data” area in “ADD NEW TRACKING” tab, there is no
   guideline on what to include in each field, or maybe I did not see it.
 * Are there any way that we can use “Dynamic variable” in the field?
    such as: [
   category], [tags], [title], [pagetype], [price_subtotal], and so on?
 * Thank you
    Alex

Viewing 1 replies (of 1 total)

 *  Plugin Author [Antonino Scarfì](https://wordpress.org/support/users/antoscarface/)
 * (@antoscarface)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/dynamic-variable/#post-11417002)
 * Hi,
 * unfortunately, there aren’t any tags already ready to use, but the plugin has
   a wordpress filter where define custom placeholders.
 * Here an example of code snippet you can use to define some custom placeholders:
 *     ```
       add_filter( 'aepc_event_placeholders', function( array $placeholders ) {
       	$categories = get_the_category();
       	$tags = get_the_tags();
   
       	$placeholders['category'] = !is_wp_error($categories) ? implode(', ', wp_list_pluck($categories, 'name') ) : '';
       	$placeholders['tags'] = !is_wp_error($tags) ? implode(', ', wp_list_pluck($tags, 'name') ) : '';
       	$placeholders['title'] = get_the_title();
       	$placeholders['price'] = ( $product = wc_get_product() ) ? $product->get_price() : '';
       	$placeholders['price_subtotal'] = WC()->cart->get_subtotal();
       	$placeholders['pagetype'] = implode(', ', array_keys(array_filter([
       		'home' => is_front_page(),
       		'blog' => is_home(),
       		'page' => is_page(),
       		'post' => is_single(),
       		// etc ...
       	])));
       	// etc...
   
       	return $placeholders;
       } );
       ```
   
 * You can put this code in the `functions.php` file of your active theme.
 * It’s a rough example, just to give the idea, but I suggest you to adapt it to
   your case or ask help to a developer if you haven’t the expertise to manage it.
 * After that, you can use the placeholders as you have defined them inside `$placeholders['
   <tag>']`, surrounded by braces. So, as for the previous example, you can use 
   then `{{category}}`, `{{tags}}`, and so on.
 * I don’t suggest you to write this from the WordPress file editor of the theme.
 * I hope it can help you.
    -  This reply was modified 7 years, 2 months ago by [Antonino Scarfì](https://wordpress.org/support/users/antoscarface/).

Viewing 1 replies (of 1 total)

The topic ‘Dynamic variable’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/pixel-caffeine_e2ce0c.svg)
 * [Pixel Caffeine](https://wordpress.org/plugins/pixel-caffeine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pixel-caffeine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pixel-caffeine/)
 * [Active Topics](https://wordpress.org/support/plugin/pixel-caffeine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pixel-caffeine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pixel-caffeine/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Antonino Scarfì](https://wordpress.org/support/users/antoscarface/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/dynamic-variable/#post-11417002)
 * Status: not resolved