Adds Google campaign tags for tracking the various states of the 'Try Storefront' button.
This commit is contained in:
parent
94da31ef01
commit
5a0a8ef2f2
|
@ -25,25 +25,34 @@ class WC_Admin_Addons {
|
|||
$text = __( 'View more about Storefront', 'woocommerce' );
|
||||
$template = get_option( 'template' );
|
||||
$stylesheet = get_option( 'stylesheet' );
|
||||
$utm_content = 'hasstorefront';
|
||||
|
||||
// If we're using Storefront with a child theme.
|
||||
if ( 'storefront' == $template && 'storefront' != $stylesheet ) {
|
||||
$url = 'http:///www.woothemes.com/product-category/themes/storefront-child-theme-themes/';
|
||||
$text = __( 'View more Storefront child themes', 'woocommerce' );
|
||||
$utm_content = 'hasstorefrontchildtheme';
|
||||
}
|
||||
|
||||
// If we're using Storefront without a child theme.
|
||||
if ( 'storefront' == $template && 'storefront' == $stylesheet ) {
|
||||
$url = 'http:///www.woothemes.com/product-category/themes/storefront-child-theme-themes/';
|
||||
$text = __( 'Need a fresh look? Try Storefront child themes', 'woocommerce' );
|
||||
$utm_content = 'nostorefrontchildtheme';
|
||||
}
|
||||
|
||||
// If we're not using Storefront at all.
|
||||
if ( 'storefront' != $template && 'storefront' != $stylesheet ) {
|
||||
$url = 'http://www.woothemes.com/storefront/';
|
||||
$text = __( 'Need a theme? Try Storefront', 'woocommerce' );
|
||||
$utm_content = 'nostorefront';
|
||||
}
|
||||
|
||||
$url = add_query_arg( 'utm_source', 'product', $url );
|
||||
$url = add_query_arg( 'utm_medium', 'upsell', $url );
|
||||
$url = add_query_arg( 'utm_campaign', 'wcaddons', $url );
|
||||
$url = add_query_arg( 'utm_content', $utm_content, $url );
|
||||
|
||||
echo '<a href="' . esc_url( $url ) . '" class="add-new-h2">' . esc_html( $text ) . '</a>' . "\n";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue