setono/sylius-plausible-plugin 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

setono/sylius-plausible-plugin

Composer 安装命令:

composer require setono/sylius-plausible-plugin

包简介

Start tracking your visitors with Plausible.io

README 文档

README

Latest Stable Version Total Downloads License PHP Version Require build codecov Mutation testing badge

Use Plausible Analytics to track visitors and events in your Sylius store.

Installation

Step 1: Install and enable the plugin

composer require setono/sylius-plausible-plugin

Step 2: Add the Plausible script identifier trait to your Channel entity

<?php

declare(strict_types=1);

namespace App\Entity\Channel;

use Doctrine\ORM\Mapping as ORM;
use Setono\SyliusPlausiblePlugin\Model\ChannelInterface as PlausibleChannelInterface;
use Setono\SyliusPlausiblePlugin\Model\ChannelPlausibleAwareTrait;
use Sylius\Component\Core\Model\Channel as BaseChannel;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_channel')]
class Channel extends BaseChannel implements PlausibleChannelInterface
{
    use ChannelPlausibleAwareTrait;
}

Step 3: Import routes

# config/routes/setono_sylius_plausible.yaml
setono_sylius_plausible:
    resource: "@SetonoSyliusPlausiblePlugin/Resources/config/routes.yaml"

Step 4: Update your database schema

bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate

Usage

Configure Plausible per channel

Navigate to Marketing > Plausible in the admin panel to configure the Plausible script for each channel.

You can enter the Plausible script in any of the following formats:

  • Identifier only: pa-hb0WlWkUb5U3qhSS-vd-a
  • Full URL: https://plausible.io/js/pa-hb0WlWkUb5U3qhSS-vd-a.js
  • HTML snippet: <script async src="https://plausible.io/js/pa-hb0WlWkUb5U3qhSS-vd-a.js"></script>

The plugin will normalize any of these formats and output the correct script tag on your storefront.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固