diff --git a/conf/app.php b/conf/app.php index 6d4f8b3..21671ac 100644 --- a/conf/app.php +++ b/conf/app.php @@ -136,6 +136,9 @@ $configs = array( //Google Analytics MEASUREMENT ID 'GA_MEASUREMENT_ID' => 'G-09MWT3Z9R0', + //Google Adwords目标跟踪ID + 'GAD_MEASUREMENT_ID' => '', + ); //自定义配置支持 diff --git a/plugins/Html.php b/plugins/Html.php index 08523ce..5448848 100644 --- a/plugins/Html.php +++ b/plugins/Html.php @@ -80,6 +80,8 @@ Class Html { $msid = !empty(FSC::$app['config']['GA_MEASUREMENT_ID']) ? FSC::$app['config']['GA_MEASUREMENT_ID'] : ''; if (empty($msid)) {return '';} + $adwords_id = !empty(FSC::$app['config']['GAD_MEASUREMENT_ID']) ? FSC::$app['config']['GAD_MEASUREMENT_ID'] : ''; + $gacode = << @@ -89,6 +91,15 @@ Class Html { gtag('js', new Date()); gtag('config', '{$msid}'); +eof; + + if (!empty($adwords_id)) { + $gacode .= << eof;