';
echo '
'.
'
Global Site Configuration (*'.$options['domain'].')
'.
'
Current options will be used as Global Configuration and also applied as default configuration when new site created. Each site configuration still can be override. Just choose from the dropdown menu above to set configuration for specific site.
'.
'
The Async Google Analytics for WordPress Multisite Have been tested on multisite configuration using sub-domains instead of sub-directory. We never been testing this plugin on multisite environment with sub-directory. Please send us any feedback if you found any bugs to bambang@minilibra.com
'.
'
';
}
///////////////////////////////////////////////// OPTION 0 ///////////////////////////////////////////////
$rows = array();
$rows[] = array(
'id' => 'uastring',
'label' => 'Analytics Account ID',
'desc' => '
What\'s this?',
'content' => '
Explanation
Find the Account ID, starting with UA- in your account overview, as marked below:
Once you have entered your Account ID in the box above your pages will be trackable by Google Analytics.
Still can\'t find it?
Read more!
'
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
$x_field_readonly = '';
$x_field_desc = '';
if( $options['tracksubdomains'] ){
$x_field_readonly = 'readonly="readonly" style="background-color:#eee;" ';
$x_field_desc = '
Since you have been activated Track Sub Domains And Merged into One Analytics Account ID then Analytics Account ID for this site always read automatically from your Global Configuration. Manual setting is not necessary.
';
}
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 0,
array(
'id' => 'uastring_'.$k,
'label' => 'Analytics Account ID for this site',
'content' => '
'.$x_field_desc,
)
);
$bloglist_options[$k]=$v;
}
}
if( $options['multisite'] && $options['ismainsite'] ){
$rows[] = array(
'id' => 'tracksubdomains',
'label' => 'Track Sub Domains And Merged into One Analytics Account ID',
'desc' => '
What\'s this?',
'content' => $this->checkbox('tracksubdomains').'
Explanation
If you activate
Multisite environment and
using sub domains then want to
merged google analytics profile into one Google Analytics Account ID for your WordPress network, you must
adjust your google analytics profile as google analytics explained at http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html#profilesKey Point 3 (Titled: "Modify your cross-domain profile with a filter to show the full domain in your content reports."). You can
view step by step guide about how to do this in below picture:
Once you have updated your Google Analytics profile, the rest will be take care by this plugin.
Still confuse about this?
Read more!
'
);
}
if( $options['multisite'] ){
if( $options['ismainsite'] ){
$content_field_html = $this->textinput('domain');
}else{
$content_field_html = '
';
}
$rows[] = array(
'id' => 'domain',
'label' => 'Domain Tracking',
'desc' => 'This allows you to set the domain that\'s set by
setDomainName for tracking subdomains, if empty this will not be set.',
'content' => $content_field_html,
);
if( $options['ismainsite'] && !empty($bloglist_options) ){
$x_field_readonly = '';
$x_field_desc = '';
if( $options['tracksubdomains'] ){
$x_field_readonly = 'readonly="readonly" style="background-color:#eee;" ';
$x_field_desc = '
Since you have been activated Track Sub Domains And Merged into One Analytics Account ID then Domain Tracking for this site always read automatically from your Global Configuration. Manual setting is not necessary.
';
}
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 0,
array(
'id' => 'domain_'.$k,
'label' => 'Domain Tracking for this site',
'content' => '
'.$x_field_desc
)
);
$bloglist_options[$k]=$v;
}
}
}
$rows[] = array(
'id' => 'useasync',
'label' => 'Use asynchronous tracking method instead of traditional.',
'desc' => 'All google analytics will use
Asynchronous Tracking method.',
'content' => $this->checkbox('useasync'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 0,
array(
'id' => 'useasync_'.$k,
'label' => 'Use asynchronous tracking method instead of traditional in this site.',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'position',
'label' => 'Where should the tracking script be placed?',
'content' => '
'
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 0,
array(
'id' => 'position_'.$k,
'label' => 'Where should the tracking script be placed in this site?',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'trackoutbound',
'label' => 'Track outbound clicks & downloads',
'desc' => '',
'content' => $this->checkbox('trackoutbound'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 0,
array(
'id' => 'trackoutbound_'.$k,
'label' => 'Track outbound clicks & downloads in this site',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'customfilter',
'label' => 'Enable/Disable custom filter tracking',
'desc' => 'Enable/Disable tracking for specified categories, tags, posts, pages, URL, or Visitor with specified IP.',
'content' => $this->checkbox('customfilter'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 0,
array(
'id' => 'customfilter_'.$k,
'label' => 'Enable/Disable custom filter tracking in this site',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'advancedsettings',
'label' => 'Show advanced settings',
'desc' => 'Only adviced for advanced users who know their way around Google Analytics',
'content' => $this->checkbox('advancedsettings'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 0,
array(
'id' => 'advancedsettings_'.$k,
'label' => 'Show advanced settings in this site',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$this->postbox('gasettings','Async Google Analytics Settings',$this->form_table($rows));
///////////////////////////////////////////////// OPTION 1 ///////////////////////////////////////////////
$rows = array();
$rows[] = array(
'id' => 'dlextensions',
'label' => 'Extensions of files to track as downloads',
'content' => $this->textinput('dlextensions'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 1,
array(
'id' => 'dlextensions_'.$k,
'label' => 'Extensions of files to track as downloads',
'content' => '
',
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'dlprefix',
'label' => 'Prefix for tracked downloads',
'content' => $this->textinput('dlprefix'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 1,
array(
'id' => 'dlprefix_'.$k,
'label' => 'Prefix for tracked downloads',
'content' => '
',
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'artprefix',
'label' => 'Prefix for outbound clicks from links in articles',
'content' => $this->textinput('artprefix'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 1,
array(
'id' => 'artprefix_'.$k,
'label' => 'Prefix for outbound clicks from links in articles',
'content' => '
',
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'comprefix',
'label' => 'Prefix for outbound clicks from links in comments',
'content' => $this->textinput('comprefix'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 1,
array(
'id' => 'comprefix_'.$k,
'label' => 'Prefix for outbound clicks from links in comments',
'content' => '
',
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'externalprefix',
'label' => 'Prefix for outbound clicks from links in all other sections',
'content' => $this->textinput('externalprefix').'
This is
prefix for all outbound clicks (
links that goes to outside your website) that found in any sections of your web pages (except those defined in
downloads,
articles or
comments section above), such as blogroll, widgets, etc. Any static links such as defined in your themes also will be
detected automatically does it goes to external url or not.',
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 1,
array(
'id' => 'externalprefix_'.$k,
'label' => 'Prefix for outbound clicks from links in all other sections',
'content' => '
',
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'domainorurl',
'label' => 'Track full URL of outbound clicks or just the domain?',
'content' => '
',
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 1,
array(
'id' => 'domainorurl_'.$k,
'label' => 'Track full URL of outbound clicks or just the domain?',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
if( !$options['multisite'] ){
$rows[] = array(
'id' => 'domain',
'label' => 'Domain Tracking',
'desc' => 'This allows you to set the domain that\'s set by
setDomainName for tracking subdomains, if empty this will not be set.',
'content' => $this->textinput('domain'),
);
}
$this->postbox('outboundgasettings','Outbound Specific Settings',$this->form_table($rows));
///////////////////////////////////////////////// OPTION 2 ///////////////////////////////////////////////
$rows = array();
$rows[] = array(
'id' => 'exclude_userrole',
'label' => 'Disable tracking for specified logged in user role',
'desc' => 'All users under selected user role will NOT be tracked if they logged in.',
'content' => '
'.get_array_checkbox_el('exclude_userrole', array(1=>'Subscriber', 2=>'Contributor', 3=>'Author', 4=>'Editor', 5=>'Administrator'), normalize_array_val($options['exclude_userrole'])),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 2,
array(
'id' => 'exclude_userrole_'.$k,
'label' => 'Disable tracking for specified logged in user role of this site',
'content' => '
'.get_array_checkbox_el('exclude_userrole_'.$k, array(1=>'Subscriber', 2=>'Contributor', 3=>'Author', 4=>'Editor', 5=>'Administrator'), normalize_array_val($v['options']['exclude_userrole'])),
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'exclude_userid',
'label' => 'Disable tracking for specified logged in User',
'desc' => 'Please enter by User ID (numeric), Username or Email seperated by commas.',
'content' => $this->textinput('exclude_userid'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 2,
array(
'id' => 'exclude_userid_'.$k,
'label' => 'Disable tracking for specified logged in User of this site',
'content' => '
',
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'trackloggedin',
'label' => 'Segment logged in users',
'content' => $this->checkbox('trackloggedin').' This is only applied for NON SELECTED
USER ROLE and NOT IN
USER LIST above when they logged in.',
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 2,
array(
'id' => 'trackloggedin_'.$k,
'label' => 'Segment logged in users of this site',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$opt = array();
foreach(get_categories('hide_empty=0&hierarchical=0') as $cat){
$opt[$cat->term_id] = $cat->cat_name;
}
$rows[] = array(
'id' => 'excludecategories',
'label' => 'Disable tracking for following categories',
'desc' => 'All checked categories will not be tracking.',
'content' => get_array_checkbox_el('excludecategories', $opt, normalize_array_val($options['excludecategories'])),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 2,
array(
'id' => 'excludecategories_'.$k,
'label' => 'Disable tracking for categories in this site',
'content' => '
Override on Specific site Settings',
)
);
$bloglist_options[$k]=$v;
}
}
$opt = array();
foreach(get_tags('hide_empty=0&hierarchical=0') as $tag){
$opt[$tag->term_id] = $tag->name;
}
$rows[] = array(
'id' => 'excludetags',
'label' => 'Disable tracking for following tags',
'desc' => 'All checked tags will not be tracking.',
'content' => get_array_checkbox_el('excludetags', $opt, normalize_array_val($options['excludetags'])),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 2,
array(
'id' => 'excludetags_'.$k,
'label' => 'Disable tracking for tags in this site',
'content' => '
Override on Specific site Settings',
)
);
$bloglist_options[$k]=$v;
}
}
$opt = array();
foreach(get_pages('hierarchical=0') as $page){
$opt[$page->ID] = $page->post_title;
}
$rows[] = array(
'id' => 'excludepages',
'label' => 'Disable tracking for following pages',
'desc' => 'All checked pages will not be tracking.',
'content' => get_array_checkbox_el('excludepages', $opt, normalize_array_val($options['excludepages'])),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 2,
array(
'id' => 'excludepages_'.$k,
'label' => 'Disable tracking for pages in this site',
'content' => '
Override on Specific site Settings',
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'excludeposts',
'label' => 'Disable tracking for following posts',
'desc' => 'Please enter the post ID seperated by commas.',
'content' => $this->textinput('excludeposts'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 2,
array(
'id' => 'excludeposts_'.$k,
'label' => 'Disable tracking for posts in this site',
'content' => '
Override on Specific site Settings',
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'excludeuri',
'label' => 'Disable tracking for following URL/URI',
'desc' => 'Please enter the url/uri. One per line.',
'content' => '
',
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 2,
array(
'id' => 'excludeuri_'.$k,
'label' => 'Disable tracking for site URL/URI in this site',
'content' => '
',
)
);
$bloglist_options[$k]=$v;
}
}
$my_ip_is = get_my_current_ip();
$rows[] = array(
'id' => 'excludeips',
'label' => 'Disable tracking for visitor from following IP',
'desc' => 'Please enter the IP. One per line. If you want to exclude yourself from being tracking, then you can add your IP here.',
'content' => '
Your current IP Address is '.$my_ip_is.'',
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 2,
array(
'id' => 'excludeips_'.$k,
'label' => 'Disable tracking for visitor of this site from following IP',
'content' => '
Your current IP Address is '.$my_ip_is.''
)
);
$bloglist_options[$k]=$v;
}
}
$this->postbox('customgafilter','Custom Filter Settings',$this->form_table($rows));
///////////////////////////////////////////////// OPTION 3 ///////////////////////////////////////////////
$rows = array();
$rows[] = array(
'id' => 'trackadsense',
'label' => 'Track AdSense',
'desc' => 'This requires integration of your Analytics and AdSense account, for help,
look here.',
'content' => $this->checkbox('trackadsense'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 3,
array(
'id' => 'trackadsense_'.$k,
'label' => 'Track AdSense in this site',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'extrase',
'label' => 'Track extra Search Engines',
'content' => $this->checkbox('extrase'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 3,
array(
'id' => 'extrase_'.$k,
'label' => 'Track extra Search Engines in this site',
'content' => ''
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'imagese',
'label' => 'Track Google Image Search as a Search Engine',
'desc' => 'This functionality is in beta, and not confirmed to work yet',
'content' => $this->checkbox('imagese'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 3,
array(
'id' => 'imagese_'.$k,
'label' => 'Track Google Image Search as a Search Engine in this site',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'userv2',
'label' => 'I use Urchin',
'content' => $this->checkbox('userv2'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 3,
array(
'id' => 'userv2_'.$k,
'label' => 'Use Urchin Trracker in this site',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'rsslinktagging',
'label' => 'Tag links in RSS feed with campaign variables',
'content' => $this->checkbox('rsslinktagging'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 3,
array(
'id' => 'rsslinktagging_'.$k,
'label' => 'Tag links in RSS feed with campaign variables for this site',
'content' => ''
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'trackregistration',
'label' => 'Add tracking to the login and registration forms',
'content' => $this->checkbox('trackregistration'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 3,
array(
'id' => 'trackregistration_'.$k,
'label' => 'Add tracking to the login and registration forms in this site',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$rows[] = array(
'id' => 'allowanchor',
'label' => 'Use # instead of ? for Campaign tracking?',
'desc' => 'This adds a
setAllowAnchor call to your tracking script, and makes RSS link tagging use a # as well.',
'content' => $this->checkbox('allowanchor'),
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 3,
array(
'id' => 'allowanchor_'.$k,
'label' => 'Use # instead of ? for Campaign tracking in this site?',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$this->postbox('advancedgasettings','Advanced Settings',$this->form_table($rows));
///////////////////////////////////////////////// OPTION 4 ///////////////////////////////////////////////
$rows = array();
$rows[] = array(
'id' => 'allow_linkback',
'label' => 'May I add credit link?',
'desc' => 'Any credit link would be appreciated.',
'content' => $this->checkbox('allow_linkback') . ' '.
'
Thank you for being my friend ^_^. As soon as your website / blog also will be added to our friends blogroll then we have get connected each other ^_^'.
'
This would help us to tell the world about this great plugin. We will be really appreciated if you can help us to share this plugin by put below text into any of your posts/pages. Your website / blog also will be added to our blogroll so we have get connected each other ^_^'.
'
',
);
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
foreach($bloglist_options as $k=>$v){
$v['html_config'] = $this->opts_html_config_push($v['html_config'], 4,
array(
'id' => 'allow_linkback_'.$k,
'label' => 'May I add credit link to this site?',
'content' => '
'
)
);
$bloglist_options[$k]=$v;
}
}
$this->postbox('gacredits','Little credit link would be appreciate',$this->form_table($rows));
if( $options['multisite'] && $options['ismainsite'] && !empty($bloglist_options) ){
echo '
';
foreach($bloglist_options as $k=>$v){
echo '