You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Twitter plugin only includes additional trackers when explicitly specified by your website or its authors. Please read Twitter's advertising tracker disclosure policies in case you need to modify your site's privacy policy before using this feature.
Copy a universal website tag from a code snippet generated on ads.twitter.com.
Supported shortcode parameters
Attribute
Description
Example
id
The Twitter advertising tracking identifier generated by Twitter's conversion tracking tools.
12b34
Set the tracking ID using a filter
A website may set tracking IDs for specific pages by acting on the associative array passed to the shortcode_atts_twitter_trackingfilter.
A shortcode parameter with no explicitly provided id attribute will return an empty string unless overridden during the WordPress filter process.
Example:
/** * Set a tracking ID for specific pages * * @param array $out Parsed user-defined valid attributes or default attribute value * @param array $pairs supported attributes and their default values * @param array $attributes user-defined attributes in the shortcode tag * * @return array options array with our customization applied */functiontwitter_tracking_custom_options( $out, $pairs, $attributes )
{
if ( is_page( 42 ) ) {
$out['id'] = '12b34';
}
return$out;
}
add_filter( 'shortcode_atts_twitter_tracking', 'twitter_tracking_custom_options', 10, 3 );