Ability to promote iOS and Android Applications with an App Banner similar to iOS6 App Banner. Utilizes jQuery Smart Banner by
Why is the AppBanner not showing up?
First thing you should do is load the non minified version of the javascript file by editing line:46 of appBanners.php
Change this
wp_register_script( ‘app-banners-scripts’, plugins_url( ‘/lib/smartbanner/jquery.smartbanner.min.js’, FILE ), array( ‘jquery’ ), false, true );
To this
wp_register_script( ‘app-banners-scripts’, plugins_url( ‘/lib/smartbanner/jquery.smartbanner.js’, FILE ), array( ‘jquery’ ), false, true );
This will then output in the console logging as to why the App Banner is not showing for you.
I have an iOS device running the latest operating system and I can not see the app banner… What gives?
Well unfortunately this is not an issue with the AppBanners plugin. For all iOS devices after iOS 6 Apple introduces their own Smart Banner.
You can read about it here
We rely on the operating system to read the META tag which AppBanners plugin injects into your site to display the native iOS App Banner. There are so many variables as to when and why Apple shows the banner and sometimes does not.
Is there a way to track the number of clicks to the install/open button on the App Banners Plugin with Javascript?
Yes. There is a couple of ways. The most preferred way would be to simply add the following code to your theme’s scripts file or a place where you can add Javascript to your theme. The other option is to add directly to your functions.php file of your theme.
Javscript Version
jQuery(document).ready(function ($) {
$(‘body’).on(‘click’, ‘.sb-button’, function(){
ga(‘send’, {
‘hitType’: ‘event’, // Required.
‘eventCategory’: ‘App Banners’, // Required.
‘eventAction’: ‘click’, // Required.
‘eventLabel’: ‘Clicked App Banner’ //Optional
});
});
});
Functions.php Version
//Start App Banner Click Tracking
add_action(‘wp_head’,’appbanners_track_clicks_js’);
function appbanners_track_clicks_js() { ?>
<script>
jQuery(document).ready(function ($) {
$('body').on('click', '.sb-button', function(){
ga('send', {
'hitType': 'event', // Required.
'eventCategory': 'App Banners', // Required.
'eventAction': 'click', // Required.
'eventLabel': 'Clicked App Banner' //Optional
});
});
});
</script>
<?php
}
//End App Banner Click Tracking