bluebirdday/speedcurve-magento 问题修复 & 功能扩展

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

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

bluebirdday/speedcurve-magento

Composer 安装命令:

composer require bluebirdday/speedcurve-magento

包简介

Integrates SpeedCurve RUM for Magento 2.

README 文档

README

Overview

This Magento 2 module integrates the Speedcurve Real User Monitoring (RUM) service, specifically the LUX script, into your Magento store. It is designed for standard Magento 2 frontend themes (Luma-based or custom themes using Layout XML, RequireJS, etc.).

The module allows you to:

  • Automatically inject the Speedcurve LUX JavaScript snippet onto your pages.
  • Send specific page labels to Speedcurve for better analysis (e.g., 'category-page' for category views, 'product-page' for product views).
  • Configure all settings via the Magento Admin Panel, including LUX ID, page labels, and cookie consent handling.

Features

  • Speedcurve RUM Integration: Injects the necessary Speedcurve LUX JavaScript.
  • Configurable LUX ID: Set your unique Speedcurve LUX ID via admin configuration.
  • Configurable Page Labels: Define custom labels sent to Speedcurve for category and product pages via admin configuration (defaults provided).
  • Standard Magento Compatibility: Uses Layout XML, Blocks, phtml templates, RequireJS, and jQuery for integration.
  • Flexible Cookie Consent:
    • Option to enable/disable cookie consent check.
    • Configure the specific cookie name used by your consent manager.
    • Configure the value (or part of a value) within the cookie that signifies consent.
    • Choose the logic for checking the cookie (existence, value contains, value does not contain).

Speedcurve Config Example

Requirements

  • Magento 2 (e.g., 2.3.x, 2.4.x)
  • Standard Magento 2 Theme (Luma-based or custom using default frontend stack)

Installation

Install the module via Composer:

composer require bluebirdday/speedcurve-magento
bin/magento module:enable Bluebirdday_SpeedcurveMagento
bin/magento setup:upgrade
bin/magento cache:flush

For production environments, run the following additional commands:

bin/magento setup:di:compile
bin/magento setup:static-content:deploy <locales>

Configuration

After installation, configure the module in the Magento Admin Panel:

  1. Go to Stores > Configuration > Bluebirdday > Speedcurve.
  2. General Settings:
    • Enable Speedcurve RUM: Yes/No - Master switch for the module.
    • LUX ID: Enter your unique ID provided by Speedcurve. Required if enabled.
    • Enable Cookie Consent Check: Yes/No - Choose whether to check for consent before loading the script.
    • Consent Cookie Name: (Only if consent check enabled) The name of the cookie your consent tool uses (e.g., CookieConsent, amcookie_allowed). Required if consent check enabled.
    • Consent Cookie Value: (Only if consent check enabled) The text value (or part of it) inside the cookie that indicates consent (e.g., performance, necessary:true, -1). Leave empty if checking only for cookie existence with the 'Cookie Exists' logic.
    • Consent Check Logic: (Only if consent check enabled) How to interpret the cookie:
      • Cookie Exists: Loads script if the cookie name exists. Ignores value.
      • Value Contains: Loads script if the cookie name exists AND its value contains the text in "Consent Cookie Value". If the value field is empty, this behaves like Cookie Exists.
      • Value Does Not Contain: Loads script if the cookie name exists AND its value does NOT contain the text in "Consent Cookie Value". If the value field is empty, this check will always fail.
  3. Page Labels:
    • Category Page Label: The label sent on category pages (default: category-page).
    • Product Page Label: The label sent on product detail pages (default: product-page).
  4. Save the configuration.

Usage

Once installed, enabled, and configured with your LUX ID (and potentially cookie consent settings), the module works automatically:

  • The layout XML (default.xml, catalog_category_view.xml, catalog_product_view.xml) adds blocks to the page.
  • These blocks render phtml templates containing text/x-magento-init scripts.
  • These scripts initialize the RequireJS modules (bluebirddaySpeedcurveRum and bluebirddaySpeedcurvePageLabel).
  • bluebirddaySpeedcurveRum.js checks cookie consent (if configured) and injects the Speedcurve LUX scripts.
  • bluebirddaySpeedcurvePageLabel.js waits for the main script to load (using a jQuery event SpeedcurveLoaded) and then sets the configured LUX.label.

You can monitor your Speedcurve RUM dashboard to see data coming in, including the page labels.

License

GNU General Public License v3.0

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Copyright (C) 2024 Bluebird Day

bluebirdday/speedcurve-magento 适用场景与选型建议

bluebirdday/speedcurve-magento 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 1.27k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2025 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 bluebirdday/speedcurve-magento 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bluebirdday/speedcurve-magento 我们能提供哪些服务?
定制开发 / 二次开发

基于 bluebirdday/speedcurve-magento 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2025-05-06