Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/accelera.../includes/features/analytic...
File: analytics-options.php
<?php
[0] Fix | Delete
use ReduxCore\ReduxFramework\Redux;
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[2] Fix | Delete
exit;
[3] Fix | Delete
}
[4] Fix | Delete
function ampforwp_get_default_analytics($param=""){
[5] Fix | Delete
$default = '';
[6] Fix | Delete
$default = ampforwp_get_setting('amp-analytics-select-option');
[7] Fix | Delete
if($param == $default){
[8] Fix | Delete
return true;
[9] Fix | Delete
}
[10] Fix | Delete
else
[11] Fix | Delete
return false;
[12] Fix | Delete
}
[13] Fix | Delete
function ampforwp_analytics_options($opt_name){
[14] Fix | Delete
// Analytics SECTION
[15] Fix | Delete
Redux::setSection( $opt_name, array(
[16] Fix | Delete
'title' => esc_html__('Analytics'),
[17] Fix | Delete
// 'icon' => 'el el-th-large',
[18] Fix | Delete
'id' => 'analytics',
[19] Fix | Delete
'subsection' => true,
[20] Fix | Delete
'fields' =>
[21] Fix | Delete
array(
[22] Fix | Delete
array(
[23] Fix | Delete
'id' => 'amp-analytics-select-option',
[24] Fix | Delete
'type' => 'select',
[25] Fix | Delete
'title' => esc_html__( 'Analytics Type', 'accelerated-mobile-pages' ),
[26] Fix | Delete
'class' => 'hide',
[27] Fix | Delete
'tooltip-subtitle' => esc_html__( 'Select your Analytics provider.', 'accelerated-mobile-pages' ),
[28] Fix | Delete
'options' => array(
[29] Fix | Delete
'1' => esc_html__('Google Analytics', 'accelerated-mobile-pages' ),
[30] Fix | Delete
'2' => esc_html__('Segment Analytics', 'accelerated-mobile-pages' ),
[31] Fix | Delete
'3' => esc_html__('Matomo (Piwik) Analytics', 'accelerated-mobile-pages' ),
[32] Fix | Delete
'4' => esc_html__('Quantcast Measurement', 'accelerated-mobile-pages' ),
[33] Fix | Delete
'5' => esc_html__('comScore', 'accelerated-mobile-pages' ),
[34] Fix | Delete
'6' => esc_html__('Effective Measure', 'accelerated-mobile-pages' ),
[35] Fix | Delete
'7' => esc_html__('StatCounter', 'accelerated-mobile-pages' ),
[36] Fix | Delete
'8' => esc_html__('Histats Analytics', 'accelerated-mobile-pages'),
[37] Fix | Delete
'9' => esc_html__('Yandex Metrika', 'accelerated-mobile-pages'),
[38] Fix | Delete
'10' => esc_html__('Chartbeat Analytics', 'accelerated-mobile-pages'),
[39] Fix | Delete
'11' => esc_html__('Alexa Metrics', 'accelerated-mobile-pages'),
[40] Fix | Delete
'12' => esc_html__('AFS Analytics', 'accelerated-mobile-pages'),
[41] Fix | Delete
'13' => esc_html__('Adobe Analytics', 'accelerated-mobile-pages'),
[42] Fix | Delete
'14' => esc_html__('Facebook Pixel', 'accelerated-mobile-pages'),
[43] Fix | Delete
'15' => esc_html__('Clicky Analytics', 'accelerated-mobile-pages'),
[44] Fix | Delete
),
[45] Fix | Delete
'default' => '1',
[46] Fix | Delete
),
[47] Fix | Delete
[48] Fix | Delete
array(
[49] Fix | Delete
'id' => 'ampforwp-analytics_1',
[50] Fix | Delete
'type' => 'section',
[51] Fix | Delete
'title' => esc_html__('Primary Analytics Provider', 'accelerated-mobile-pages'),
[52] Fix | Delete
'indent' => true,
[53] Fix | Delete
'layout_type' => 'accordion',
[54] Fix | Delete
'accordion-open'=> 1,
[55] Fix | Delete
),
[56] Fix | Delete
// Google Analytics
[57] Fix | Delete
array(
[58] Fix | Delete
'id' => 'ampforwp-ga-switch',
[59] Fix | Delete
'type' => 'switch',
[60] Fix | Delete
'title' => 'Google Analytics',
[61] Fix | Delete
'default' => ampforwp_get_default_analytics('1'),
[62] Fix | Delete
'required' => array(
[63] Fix | Delete
array('amp-use-gtm-option', '=' , '0'),
[64] Fix | Delete
),
[65] Fix | Delete
),
[66] Fix | Delete
array(
[67] Fix | Delete
'class' => 'child_opt child_opt_arrow',
[68] Fix | Delete
'id' => 'ga-feild',
[69] Fix | Delete
'type' => 'text',
[70] Fix | Delete
'title' => esc_html__( 'Tracking ID', 'accelerated-mobile-pages' ),
[71] Fix | Delete
'required' => array(
[72] Fix | Delete
array('amp-use-gtm-option', '=' , '0'),
[73] Fix | Delete
array('ampforwp-ga-switch', '=' , '1'),
[74] Fix | Delete
array('ampforwp-ga-field-advance-switch', '=' , '0')
[75] Fix | Delete
),
[76] Fix | Delete
'tooltip-subtitle' => esc_html__( 'Enter your Google Analytics ID. Example: UA-XXXXX-Y', 'accelerated-mobile-pages' ),
[77] Fix | Delete
'default' => 'UA-XXXXX-Y',
[78] Fix | Delete
),
[79] Fix | Delete
array(
[80] Fix | Delete
'class' => 'child_opt',
[81] Fix | Delete
'id' => 'ampforwp-ga-field-anonymizeIP',
[82] Fix | Delete
'type' => 'switch',
[83] Fix | Delete
'title' => esc_html__( 'IP Anonymization', 'accelerated-mobile-pages' ),
[84] Fix | Delete
'required' => array(
[85] Fix | Delete
array('amp-use-gtm-option', '=' , '0'),
[86] Fix | Delete
array('ampforwp-ga-switch', '=' , '1')
[87] Fix | Delete
),
[88] Fix | Delete
'default' => 1,
[89] Fix | Delete
),
[90] Fix | Delete
array(
[91] Fix | Delete
'class' => 'child_opt',
[92] Fix | Delete
'id' => 'ampforwp-ga-field-linker',
[93] Fix | Delete
'type' => 'switch',
[94] Fix | Delete
'title' => esc_html__( 'AMP Linker', 'accelerated-mobile-pages' ),
[95] Fix | Delete
'required' => array('ampforwp-ga-switch', '=' , '1'),
[96] Fix | Delete
'tooltip-subtitle' => sprintf( '<a href="%s" target="_blank">%s</a> %s',
[97] Fix | Delete
esc_url('https://amphtml.wordpress.com/2018/09/17/measuring-user-journeys-across-the-amp-cache-and-your-website/amp/'),
[98] Fix | Delete
esc_html__( 'Click Here','accelerated-mobile-pages' ),
[99] Fix | Delete
esc_html__( 'for more details on AMP Linker','accelerated-mobile-pages' ) ),
[100] Fix | Delete
'default' => 0,
[101] Fix | Delete
),
[102] Fix | Delete
array(
[103] Fix | Delete
'class' => 'child_opt',
[104] Fix | Delete
'id' => 'ampforwp-ga-field-author',
[105] Fix | Delete
'type' => 'switch',
[106] Fix | Delete
'title' => esc_html__( 'Author Pageview', 'accelerated-mobile-pages' ),
[107] Fix | Delete
'required' => array('ampforwp-ga-switch', '=' , '1'),
[108] Fix | Delete
'tooltip-subtitle' => sprintf( '<a href="%s" target="_blank">%s</a> %s',
[109] Fix | Delete
esc_url('https://ampforwp.com/tutorials/article/how-to-track-author-pageview-analytics-in-amp'),
[110] Fix | Delete
esc_html__( 'Click Here','accelerated-mobile-pages' ),
[111] Fix | Delete
esc_html__( 'for more details on Author Pageview','accelerated-mobile-pages' ) ),
[112] Fix | Delete
'default' => 0,
[113] Fix | Delete
),
[114] Fix | Delete
array(
[115] Fix | Delete
'class'=>'child_opt child_opt_arrow',
[116] Fix | Delete
'id' =>'ampforwp-ga-field-author-index',
[117] Fix | Delete
'type' => 'text',
[118] Fix | Delete
'title' => esc_html__('Index of Author','accelerated-mobile-pages'),
[119] Fix | Delete
'default' => '',
[120] Fix | Delete
'tooltip-subtitle' => 'Index number of author in custom dimension section',
[121] Fix | Delete
'required' =>
[122] Fix | Delete
array('ampforwp-ga-field-author', '=' , '1'),
[123] Fix | Delete
),
[124] Fix | Delete
// Advance Tracking options for Google Analytics
[125] Fix | Delete
array(
[126] Fix | Delete
'class' => 'child_opt',
[127] Fix | Delete
'id' => 'ampforwp-ga-field-advance-switch',
[128] Fix | Delete
'type' => 'switch',
[129] Fix | Delete
'title' => esc_html__( 'Customize Configuration', 'accelerated-mobile-pages' ),
[130] Fix | Delete
'required' => array(
[131] Fix | Delete
array('amp-use-gtm-option', '=' , '0'),
[132] Fix | Delete
array('ampforwp-ga-switch', '=' , '1')
[133] Fix | Delete
),
[134] Fix | Delete
'default' => 0,
[135] Fix | Delete
),
[136] Fix | Delete
array(
[137] Fix | Delete
'class' => 'child_opt',
[138] Fix | Delete
'id' => 'ampforwp-ga-field-advance',
[139] Fix | Delete
'type' => 'ace_editor',
[140] Fix | Delete
'title' => esc_html__('Analytics Code in JSON Format', 'accelerated-mobile-pages'),
[141] Fix | Delete
'tooltip-subtitle' => sprintf( '%s<a href="%s" target="_blank">%s</a>', esc_html__( 'Tutorial: ','accelerated-mobile-pages' ), esc_url('https://ampforwp.com/tutorials/article/add-advanced-google-analytics-amp/'), esc_html__( 'How To Add Advanced Google Analytics in AMP?','accelerated-mobile-pages' ) ),
[142] Fix | Delete
'required' => array(
[143] Fix | Delete
array('amp-use-gtm-option', '=' , '0'),
[144] Fix | Delete
array('ampforwp-ga-switch', '=' , '1'),
[145] Fix | Delete
array('ampforwp-ga-field-advance-switch', '=' , '1')
[146] Fix | Delete
),
[147] Fix | Delete
'mode' => 'javascript',
[148] Fix | Delete
'theme' => 'monokai',
[149] Fix | Delete
'desc' => '',
[150] Fix | Delete
'default' => ('{
[151] Fix | Delete
"vars" : {
[152] Fix | Delete
"gtag_id": "UA-xxxxxxx-x",
[153] Fix | Delete
"config" : {
[154] Fix | Delete
"UA-xxxxxxx-x": { "groups": "default" }
[155] Fix | Delete
}
[156] Fix | Delete
},
[157] Fix | Delete
"triggers": {
[158] Fix | Delete
"trackPageview": {
[159] Fix | Delete
"on": "visible",
[160] Fix | Delete
"request": "pageview"
[161] Fix | Delete
}
[162] Fix | Delete
}
[163] Fix | Delete
}')
[164] Fix | Delete
),
[165] Fix | Delete
[166] Fix | Delete
// Google Analytics 4
[167] Fix | Delete
array(
[168] Fix | Delete
'id' => 'ampforwp-ga4-switch',
[169] Fix | Delete
'type' => 'switch',
[170] Fix | Delete
'title' => 'Google Analytics 4',
[171] Fix | Delete
'tooltip-subtitle' => esc_html__( 'Enable Google Analytics 4 in AMP.', 'accelerated-mobile-pages' ),
[172] Fix | Delete
'default' => 0,
[173] Fix | Delete
),
[174] Fix | Delete
array(
[175] Fix | Delete
'class' => 'child_opt child_opt_arrow',
[176] Fix | Delete
'id' => 'ampforwp-ga4-id',
[177] Fix | Delete
'type' => 'text',
[178] Fix | Delete
'title' => esc_html__( 'GA4 Measurement ID', 'accelerated-mobile-pages' ),
[179] Fix | Delete
'required' => array(
[180] Fix | Delete
array('ampforwp-ga4-switch', '=' , '1'),
[181] Fix | Delete
array('ampforwp-ga4-field-advance-switch', '=' , '0'),
[182] Fix | Delete
),
[183] Fix | Delete
'tooltip-subtitle' => esc_html__( 'Enter your Your Measurement ID Example: G-XXXXXXXX', 'accelerated-mobile-pages' ),
[184] Fix | Delete
'default' => 'G-XXXXXXXX',
[185] Fix | Delete
),
[186] Fix | Delete
array(
[187] Fix | Delete
'class' => 'child_opt',
[188] Fix | Delete
'id' => 'ampforwp-ga4-gce',
[189] Fix | Delete
'type' => 'switch',
[190] Fix | Delete
'title' => esc_html__( 'Google Consent Enabled', 'accelerated-mobile-pages' ),
[191] Fix | Delete
'required' => array(
[192] Fix | Delete
array('ampforwp-ga4-switch', '=' , '1'),
[193] Fix | Delete
array('ampforwp-ga4-field-advance-switch', '=' , '0'),
[194] Fix | Delete
),
[195] Fix | Delete
'tooltip-subtitle' => esc_html__( 'If this option is enabled then &gcs parameter will be added to the payloads with the current Consent Status', 'accelerated-mobile-pages' ),
[196] Fix | Delete
'default' => 0,
[197] Fix | Delete
),
[198] Fix | Delete
array(
[199] Fix | Delete
'class' => 'child_opt',
[200] Fix | Delete
'id' => 'ampforwp-ga4-wvt',
[201] Fix | Delete
'type' => 'switch',
[202] Fix | Delete
'title' => esc_html__( 'Webvitals Tracking', 'accelerated-mobile-pages' ),
[203] Fix | Delete
'required' => array(
[204] Fix | Delete
array('ampforwp-ga4-switch', '=' , '1'),
[205] Fix | Delete
array('ampforwp-ga4-field-advance-switch', '=' , '0'),
[206] Fix | Delete
),
[207] Fix | Delete
'tooltip-subtitle' => esc_html__( 'If this option is enabled then webvitals event will fire 5 seconds after the page is visible', 'accelerated-mobile-pages' ),
[208] Fix | Delete
'default' => 0,
[209] Fix | Delete
),
[210] Fix | Delete
array(
[211] Fix | Delete
'class' => 'child_opt',
[212] Fix | Delete
'id' => 'ampforwp-ga4-ptt',
[213] Fix | Delete
'type' => 'switch',
[214] Fix | Delete
'title' => esc_html__( 'Performance Timing Tracking', 'accelerated-mobile-pages' ),
[215] Fix | Delete
'required' => array(
[216] Fix | Delete
array('ampforwp-ga4-switch', '=' , '1'),
[217] Fix | Delete
array('ampforwp-ga4-field-advance-switch', '=' , '0'),
[218] Fix | Delete
),
[219] Fix | Delete
'tooltip-subtitle' => esc_html__( 'If this option is enabled then performance_timing event including the current page load performance timings', 'accelerated-mobile-pages' ),
[220] Fix | Delete
'default' => 0,
[221] Fix | Delete
),
[222] Fix | Delete
// Advance Tracking options for Google Analytics
[223] Fix | Delete
array(
[224] Fix | Delete
'class' => 'child_opt',
[225] Fix | Delete
'id' => 'ampforwp-ga4-field-advance-switch',
[226] Fix | Delete
'type' => 'switch',
[227] Fix | Delete
'title' => esc_html__( 'Customize Configuration', 'accelerated-mobile-pages' ),
[228] Fix | Delete
'required' => array(
[229] Fix | Delete
array('amp-use-gtm-option', '=' , '0'),
[230] Fix | Delete
array('ampforwp-ga4-switch', '=' , '1')
[231] Fix | Delete
),
[232] Fix | Delete
'default' => 0,
[233] Fix | Delete
),
[234] Fix | Delete
array(
[235] Fix | Delete
'class' => 'child_opt',
[236] Fix | Delete
'id' => 'ampforwp-ga4-field-advance',
[237] Fix | Delete
'type' => 'ace_editor',
[238] Fix | Delete
'title' => esc_html__('Analytics Code in JSON Format', 'accelerated-mobile-pages'),
[239] Fix | Delete
'tooltip-subtitle' => sprintf( '%s<a href="%s" target="_blank">%s</a>', esc_html__( 'Tutorial: ','accelerated-mobile-pages' ), esc_url('https://ampforwp.com/tutorials/article/how-to-add-ga4-in-ampforwp/'), esc_html__( 'How To Add Advanced Google Analytics in AMP?','accelerated-mobile-pages' ) ),
[240] Fix | Delete
'required' => array(
[241] Fix | Delete
array('amp-use-gtm-option', '=' , '0'),
[242] Fix | Delete
array('ampforwp-ga4-switch', '=' , '1'),
[243] Fix | Delete
array('ampforwp-ga4-field-advance-switch', '=' , '1')
[244] Fix | Delete
),
[245] Fix | Delete
'mode' => 'javascript',
[246] Fix | Delete
'theme' => 'monokai',
[247] Fix | Delete
'default' => ('{
[248] Fix | Delete
"vars":{
[249] Fix | Delete
"gtag_id":"G-XXXXXXXXXX",
[250] Fix | Delete
"config":{
[251] Fix | Delete
"G-XXXXXXXXXX":{"groups":"default"}
[252] Fix | Delete
}
[253] Fix | Delete
},
[254] Fix | Delete
"triggers":{
[255] Fix | Delete
"trackPageview":{
[256] Fix | Delete
"on":"visible","request":"pageview"
[257] Fix | Delete
}
[258] Fix | Delete
}
[259] Fix | Delete
}'),
[260] Fix | Delete
),
[261] Fix | Delete
[262] Fix | Delete
//GTM
[263] Fix | Delete
array(
[264] Fix | Delete
'id' => 'amp-use-gtm-option',
[265] Fix | Delete
'type' => 'switch',
[266] Fix | Delete
'title' => esc_html__( 'Google Tag Manager', 'accelerated-mobile-pages' ),
[267] Fix | Delete
'tooltip-subtitle' => esc_html__( 'Enable GTM Support in AMP.', 'accelerated-mobile-pages' ),
[268] Fix | Delete
'default' => 0,
[269] Fix | Delete
),
[270] Fix | Delete
array(
[271] Fix | Delete
'class'=>'child_opt child_opt_arrow',
[272] Fix | Delete
'id' =>'amp-gtm-id',
[273] Fix | Delete
'type' => 'text',
[274] Fix | Delete
'title' => esc_html__('Tag Manager ID (Container ID)','accelerated-mobile-pages'),
[275] Fix | Delete
'default' => '',
[276] Fix | Delete
'tooltip-subtitle' => sprintf('Eg: GTM-5XXXXXP (<a href="%s" style="color:#f1f1f1;">%s</a>)', esc_url('https://ampforwp.com/tutorials/article/gtm-in-amp/'), esc_html( 'Getting Started?', 'accelerated-mobile-pages') ),
[277] Fix | Delete
// 'validate' => 'not_empty',
[278] Fix | Delete
'required' => array(
[279] Fix | Delete
array('amp-use-gtm-option', '=' , '1')
[280] Fix | Delete
),
[281] Fix | Delete
),
[282] Fix | Delete
array(
[283] Fix | Delete
'class'=>'child_opt child_opt_arrow',
[284] Fix | Delete
'id' =>'amp-gtm-analytics-code',
[285] Fix | Delete
'type' => 'text',
[286] Fix | Delete
'title' => esc_html__('Analytics ID','accelerated-mobile-pages'),
[287] Fix | Delete
'default' => '',
[288] Fix | Delete
'tooltip-subtitle' => 'Eg: UA-XXXXXX-Y',
[289] Fix | Delete
'required' => array(
[290] Fix | Delete
array('amp-use-gtm-option', '=' , '1'),
[291] Fix | Delete
array('ampforwp-gtm-field-advance-switch', '=' , '0'),
[292] Fix | Delete
),
[293] Fix | Delete
),
[294] Fix | Delete
array(
[295] Fix | Delete
'class' => 'child_opt',
[296] Fix | Delete
'id' => 'ampforwp-gtm-field-advance-switch',
[297] Fix | Delete
'type' => 'switch',
[298] Fix | Delete
'title' => esc_html__( 'Advanced Google Analytics', 'accelerated-mobile-pages' ),
[299] Fix | Delete
'required' => array(
[300] Fix | Delete
array('amp-use-gtm-option', '=' , '1'),
[301] Fix | Delete
),
[302] Fix | Delete
'default' => 0,
[303] Fix | Delete
),
[304] Fix | Delete
array(
[305] Fix | Delete
'class' => 'child_opt',
[306] Fix | Delete
'id' => 'ampforwp-gtm-field-advance',
[307] Fix | Delete
'type' => 'ace_editor',
[308] Fix | Delete
'title' => esc_html__('Analytics Code in JSON Format', 'accelerated-mobile-pages'),
[309] Fix | Delete
'tooltip-subtitle' => sprintf( '%s<a href="%s" target="_blank">%s</a>', esc_html__( 'Tutorial: ','accelerated-mobile-pages' ), esc_url('https://ampforwp.com/tutorials/article/how-to-track-a-click-event-in-gtm-amp/'), esc_html__( 'How To Add Advanced Google Tag Manager in AMP?','accelerated-mobile-pages' ) ),
[310] Fix | Delete
'required' => array(
[311] Fix | Delete
array('amp-use-gtm-option', '=' , '1'),
[312] Fix | Delete
array('ampforwp-gtm-field-advance-switch', '=' , '1')
[313] Fix | Delete
),
[314] Fix | Delete
'mode' => 'javascript',
[315] Fix | Delete
'theme' => 'monokai',
[316] Fix | Delete
'desc' => '',
[317] Fix | Delete
'default' => ('{
[318] Fix | Delete
"vars": { "account": "UA-XXXXXX-Y"}
[319] Fix | Delete
}')
[320] Fix | Delete
),
[321] Fix | Delete
array(
[322] Fix | Delete
'class' => 'child_opt',
[323] Fix | Delete
'id' => 'ampforwp-gtm-field-anonymizeIP',
[324] Fix | Delete
'type' => 'switch',
[325] Fix | Delete
'title' => esc_html__( 'IP Anonymization', 'accelerated-mobile-pages' ),
[326] Fix | Delete
'required' => array(
[327] Fix | Delete
array('amp-use-gtm-option', '=' , '1'),
[328] Fix | Delete
),
[329] Fix | Delete
'default' => 1,
[330] Fix | Delete
),
[331] Fix | Delete
// Google Cliend ID API
[332] Fix | Delete
array(
[333] Fix | Delete
'id' => 'ampforwp-ga-clientid-api-gtm',
[334] Fix | Delete
'type' => 'info',
[335] Fix | Delete
'style' => 'info',
[336] Fix | Delete
'desc' => sprintf('<a href="%s" target="_blank">%s</a>', esc_url('https://ampforwp.com/tutorials/article/set-google-amp-client-id-api/'), esc_html__( 'Check this Tutorial to set it up', 'accelerated-mobile-pages' ) ),
[337] Fix | Delete
'title' => esc_html__('Set up Google AMP Client ID API', 'accelerated-mobile-pages'),
[338] Fix | Delete
'required' => array(
[339] Fix | Delete
array('amp-use-gtm-option', '=' , '1'),
[340] Fix | Delete
),
[341] Fix | Delete
),
[342] Fix | Delete
[343] Fix | Delete
array(
[344] Fix | Delete
'id' => 'ampforwp-analytics-conversion-goals',
[345] Fix | Delete
'type' => 'section',
[346] Fix | Delete
'title' => esc_html__('Google Analytics Conversion Goals', 'accelerated-mobile-pages'),
[347] Fix | Delete
'indent' => true,
[348] Fix | Delete
'layout_type' => 'accordion',
[349] Fix | Delete
'accordion-open'=> 1,
[350] Fix | Delete
'required' => array(
[351] Fix | Delete
array('amp-use-gtm-option', '=' , '0'),
[352] Fix | Delete
),
[353] Fix | Delete
),
[354] Fix | Delete
[355] Fix | Delete
[356] Fix | Delete
array(
[357] Fix | Delete
'id' => 'ampforwp-analytics-conversion-goals-switch',
[358] Fix | Delete
'type' => 'switch',
[359] Fix | Delete
'title' => 'Conversion Tracking for GA',
[360] Fix | Delete
'default' => 0,
[361] Fix | Delete
'required' => array(
[362] Fix | Delete
array('amp-use-gtm-option', '=' , '0'),
[363] Fix | Delete
),
[364] Fix | Delete
),
[365] Fix | Delete
array(
[366] Fix | Delete
'id' => 'ampforwp-analytics-conversion-goals-info',
[367] Fix | Delete
'type' => 'info',
[368] Fix | Delete
'required' => array(
[369] Fix | Delete
array('ampforwp-analytics-conversion-goals-switch', '=' , true),
[370] Fix | Delete
),
[371] Fix | Delete
'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/addons/conversion-goals-tracking-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/addons/conversion-goals-tracking-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Conversion Goals Tracking for AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
[372] Fix | Delete
),
[373] Fix | Delete
[374] Fix | Delete
[375] Fix | Delete
array(
[376] Fix | Delete
'id' => 'ampforwp-analytics_2',
[377] Fix | Delete
'type' => 'section',
[378] Fix | Delete
'title' => esc_html__('General Analytics Providers', 'accelerated-mobile-pages'),
[379] Fix | Delete
'indent' => true,
[380] Fix | Delete
'layout_type' => 'accordion',
[381] Fix | Delete
'accordion-open'=> 1,
[382] Fix | Delete
),
[383] Fix | Delete
array(
[384] Fix | Delete
'id' =>'amp-fb-pixel',
[385] Fix | Delete
'type' => 'switch',
[386] Fix | Delete
'title' => esc_html__('Facebook Pixel','accelerated-mobile-pages'),
[387] Fix | Delete
'default' => 0,
[388] Fix | Delete
'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
[389] Fix | Delete
esc_html__('Enable this option to track facebook pixel in AMP and', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-add-facebook-pixel-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages')),
[390] Fix | Delete
),
[391] Fix | Delete
array(
[392] Fix | Delete
'id' =>'amp-fb-pixel-id',
[393] Fix | Delete
'type' => 'text',
[394] Fix | Delete
'title' => esc_html__('Facebook Pixel ID','accelerated-mobile-pages'),
[395] Fix | Delete
'default' => '',
[396] Fix | Delete
'desc' => 'Example: 153246987501548',
[397] Fix | Delete
'required' => array(
[398] Fix | Delete
array('amp-fb-pixel', '=' , '1')),
[399] Fix | Delete
),
[400] Fix | Delete
// Segment Analytics
[401] Fix | Delete
array(
[402] Fix | Delete
'id' => 'ampforwp-Segment-switch',
[403] Fix | Delete
'type' => 'switch',
[404] Fix | Delete
'title' => 'Segment Analytics',
[405] Fix | Delete
'default' => ampforwp_get_default_analytics('2'),
[406] Fix | Delete
'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
[407] Fix | Delete
esc_html__('Enable this option to track segment analytics in AMP and', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-add-segment-analytics-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages')),
[408] Fix | Delete
),
[409] Fix | Delete
array(
[410] Fix | Delete
'id' => 'sa-feild',
[411] Fix | Delete
'type' => 'text',
[412] Fix | Delete
'title' => esc_html__( 'Segment Analytics', 'accelerated-mobile-pages' ),
[413] Fix | Delete
'tooltip-subtitle' => esc_html__( 'Enter your Segment Analytics Key.', 'accelerated-mobile-pages' ),
[414] Fix | Delete
'required' => array(
[415] Fix | Delete
array('ampforwp-Segment-switch', '=' , '1')
[416] Fix | Delete
),
[417] Fix | Delete
'default' => 'SEGMENT-WRITE-KEY',
[418] Fix | Delete
),
[419] Fix | Delete
// Piwik Analytics
[420] Fix | Delete
array(
[421] Fix | Delete
'id' => 'ampforwp-Piwik-switch',
[422] Fix | Delete
'type' => 'switch',
[423] Fix | Delete
'title' => esc_html__('Matomo (Piwik) Analytics', 'accelerated-mobile-pages' ),
[424] Fix | Delete
'default' => ampforwp_get_default_analytics('3'),
[425] Fix | Delete
'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
[426] Fix | Delete
esc_html__('Enable this option to track matomo (piwik) analytics in AMP and', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-add-matomo-piwik-analytics-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages')),
[427] Fix | Delete
),
[428] Fix | Delete
array(
[429] Fix | Delete
'id' => 'pa-feild',
[430] Fix | Delete
'class' => 'child_opt',
[431] Fix | Delete
'type' => 'multi_text',
[432] Fix | Delete
'title' => esc_html__( ' Enter Your Piwik Analytics URL', 'accelerated-mobile-pages' ),
[433] Fix | Delete
'desc'=>sprintf( 'Example -
[434] Fix | Delete
https://YOUR_PIWIK_BASE_INSTALLATION_URL/piwik.php?idsite=1&amp;rec=1&amp;
[435] Fix | Delete
action_name=TITLE&amp;urlref=DOCUMENT_REFERRER&amp;url=CANONICAL_URL&amp;
[436] Fix | Delete
rand=RANDOM <a href="https://ampforwp.com/tutorials/article/how-to-add-matomo-piwik-analytics-in-amp/" target="_blank">%s</a>',esc_html__('View integration tutorial','accelerated-mobile-pages' )),
[437] Fix | Delete
'required' => array(
[438] Fix | Delete
array('ampforwp-Piwik-switch', '=' , '1')
[439] Fix | Delete
),
[440] Fix | Delete
'tooltip-subtitle' => sprintf('%s<a href="%s" target="_blank">%s</a>', esc_html__( 'Tutorial: ','accelerated-mobile-pages' ), esc_url('https://ampforwp.com/tutorials/article/how-to-add-matomo-piwik-analytics-in-amp/'), esc_html__( 'How to add Matomo Piwik Analytics in AMP?','accelerated-mobile-pages') ),
[441] Fix | Delete
'default' => '',
[442] Fix | Delete
),
[443] Fix | Delete
// Piwik PRO Analytics
[444] Fix | Delete
array(
[445] Fix | Delete
'id' => 'ampforwp-Piwik-Pro-switch',
[446] Fix | Delete
'type' => 'switch',
[447] Fix | Delete
'title' => esc_html__('Piwik Pro Analytics', 'accelerated-mobile-pages' ),
[448] Fix | Delete
'default' => ampforwp_get_default_analytics('17'),
[449] Fix | Delete
'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
[450] Fix | Delete
esc_html__('Enable this option to track matomo Piwik Pro analytics in AMP and', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-add-piwik-pro-analytics-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages')),
[451] Fix | Delete
),
[452] Fix | Delete
array(
[453] Fix | Delete
'id' => 'ppas-host',
[454] Fix | Delete
'class' => 'child_opt',
[455] Fix | Delete
'type' => 'text',
[456] Fix | Delete
'title' => esc_html__( ' Piwik PRO Host URL', 'accelerated-mobile-pages' ),
[457] Fix | Delete
'desc'=>sprintf( 'Example - analytics.example.com') ,
[458] Fix | Delete
'required' => array(
[459] Fix | Delete
array('ampforwp-Piwik-Pro-switch', '=' , '1')
[460] Fix | Delete
),
[461] Fix | Delete
'tooltip-subtitle' => sprintf('%s<a href="%s" target="_blank">%s</a>', esc_html__( 'Tutorial: ','accelerated-mobile-pages' ), esc_url('https://ampforwp.com/tutorials/article/how-to-add-piwik-pro-analytics-in-amp/'), esc_html__( 'How to add Piwik Pro nalytics in AMP?','accelerated-mobile-pages') ),
[462] Fix | Delete
'default' => '',
[463] Fix | Delete
),
[464] Fix | Delete
array(
[465] Fix | Delete
'id' => 'ppas-website-id',
[466] Fix | Delete
'class' => 'child_opt',
[467] Fix | Delete
'type' => 'text',
[468] Fix | Delete
'title' => esc_html__( ' Piwik PRO Website Id', 'accelerated-mobile-pages' ),
[469] Fix | Delete
'desc'=>sprintf( 'Example - 12345678-1234-1234-1234-1234567890ab') ,
[470] Fix | Delete
'required' => array(
[471] Fix | Delete
array('ampforwp-Piwik-Pro-switch', '=' , '1')
[472] Fix | Delete
),
[473] Fix | Delete
'tooltip-subtitle' => sprintf('%s<a href="%s" target="_blank">%s</a>', esc_html__( 'Tutorial: ','accelerated-mobile-pages' ), esc_url('https://ampforwp.com/tutorials/article/how-to-add-piwik-pro-analytics-in-amp/'), esc_html__( 'How to add Piwik Pro Analytics in AMP?','accelerated-mobile-pages') ),
[474] Fix | Delete
'default' => '',
[475] Fix | Delete
),
[476] Fix | Delete
array(
[477] Fix | Delete
'id' => 'ppas-website-hash',
[478] Fix | Delete
'class' => 'child_opt',
[479] Fix | Delete
'type' => 'text',
[480] Fix | Delete
'title' => esc_html__( ' Piwik PRO Website hash', 'accelerated-mobile-pages' ),
[481] Fix | Delete
'desc'=>sprintf( 'Example - cdef') ,
[482] Fix | Delete
'required' => array(
[483] Fix | Delete
array('ampforwp-Piwik-Pro-switch', '=' , '1')
[484] Fix | Delete
),
[485] Fix | Delete
'tooltip-subtitle' => sprintf('%s<a href="%s" target="_blank">%s</a>', esc_html__( 'Tutorial: ','accelerated-mobile-pages' ), esc_url('https://ampforwp.com/tutorials/article/how-to-add-piwik-pro-analytics-in-amp/'), esc_html__( 'How to add Piwik Pro Analytics in AMP?','accelerated-mobile-pages') ),
[486] Fix | Delete
'default' => '',
[487] Fix | Delete
),
[488] Fix | Delete
array(
[489] Fix | Delete
'id' => 'ppas-advanced-tracking',
[490] Fix | Delete
'class' => 'child_opt',
[491] Fix | Delete
'type' => 'switch',
[492] Fix | Delete
'title' => esc_html__('Advance Tracking', 'accelerated-mobile-pages' ),
[493] Fix | Delete
'required' => array(
[494] Fix | Delete
array('ampforwp-Piwik-Pro-switch', '=' , '1')
[495] Fix | Delete
),
[496] Fix | Delete
esc_html__('Enable this option to add custom triggers to Piwik Pro analytics in AMP and', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-add-piwik-pro-analytics-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages'),
[497] Fix | Delete
),
[498] Fix | Delete
array(
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function