定制 vineyard/statamic-ga-dashboard 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vineyard/statamic-ga-dashboard

最新稳定版本:v1.0.3

Composer 安装命令:

composer require vineyard/statamic-ga-dashboard

包简介

README 文档

README

Statamic GA Dashboard is a Statamic addon that adds a Google Analytics widget to your Statamic dashboard, letting site users/owners see how much traffic is coming to their site.

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require vineyard/statamic-ga-dashboard

Publish the addon's config file:

php artisan vendor:publish --provider="Vineyard\StatamicGaDashboard\ServiceProvider"

This addon relies on the Spatie Laravel Analytics package and you'll need to follow their excellent instructions on obtaining credentials to communicate with Google Analytics.

After folling the instructions to get GA credentials, you'll need to copy the credentails file to following place. This is a file you'll want to reference in your site's .gitignore to keep it from being committed to a Git repo.

/storage/app/analytics/service-account-credentials.json

You'll also have a ANALYTICS_PROPERTY_ID listed in your .env file, siilar to this:

ANALYTICS_PROPERTY_ID=##########

How to Use

Add the GA Dashboard widget to a dashboard in Statamic by changing the Dashboard Widgets config in config/statamic/cp to include the ga_traffic widget.

/*
|--------------------------------------------------------------------------
| Dashboard Widgets
|--------------------------------------------------------------------------
|
| Here you may define any number of dashboard widgets. You're free to
| use the same widget multiple times in different configurations.
|
*/

'widgets' => [
    'getting_started',
    [
        'type' => 'ga_traffic',
    ]
],

You can change the number of days show on the widget's chart by changing the number of days in the addon's configuration file at config/statamic-ga-dashboard.php.

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-12-09