contactlab / magento2-hub
Magento 2 的 Contacthub 模块
Requires
- php: ~5.5.0|~5.6.0|~7.0.0|~7.1.0|~7.2.0
- contactlab/magento2-core: *
README
Contacthub Connect for Magento 2.x
版本 1.0.0
安装和配置指南
内容
简介
Contacthub Magento 2 插件允许您自动将客户在电子商务平台上进行的所有活动发送到 Contacthub,而无需编写任何代码。该扩展自动收集个人客户信息,例如
他们访问的页面。他们添加到或从购物车中删除的产品。他们完成的订单。它还确保可能有价值的信息不会丢失,通过保留与尚未识别的客户相关的事件和动作,例如,他们未登录,或他们尚未注册。数据由 Contacthub 存储,以便在稍后识别客户时立即与之关联。
要求
Contacthub Magento 2 插件需要 Magento CE 版本 2.x。有关 Magento 2 系统要求的详细信息可在 Magento 网站上找到。
GitHub 上的 Contacthub Magento 插件的 Magento CE 版本 1.9 的替代版本可在 https://github.com/contactlab/contacthub-connect-magento 获取。
安装 Magento 2 插件
登录到 Magento 管理员,点击 系统 > 缓存管理 并启用所有缓存类型。
建议您使用 composer 安装插件,在 Magento 2 根目录中运行以下命令
composer require contactlab/magento2-hub
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
点击 系统 > 缓存管理 然后点击 刷新缓存存储。 从 Magento管理后台 登出,然后重新登录,以便让Magento刷新权限。 配置 Magento 插件
登录到 Magento管理后台,然后点击 Contactlab > 配置 > Hub。
在 设置 下,在相应的字段中输入或粘贴 APIToken、API Workspace ID 和 API Node ID 的详细信息。
在 JavaScript跟踪 > 启用JS跟踪 下,选择 是,然后输入或粘贴来自Hub的 不受信任的令牌。
如果您选择 否,则Contacthub仅跟踪已订阅新闻通讯的客户遗弃购物车事件。
在 发送遗弃购物车事件前的最大分钟数 下,输入遗弃购物车事件应跟踪的最大分钟数。
输入 Hub属性 的名称,然后选择 Hub类型,例如,一个 基础 属性。
在 计划任务导出事件设置 > 限制导出事件 下设置适当的限制,例如,30。
在 计划任务前客户设置 下,根据需要配置将早期客户设置导出到Hub
点击 Contactlab > 事件日志 以查看已处理的事件,或点击 仪表板 进行关键指标的综合分析。
附录 A:Magento 插件在 Contacthub 中保存哪些客户数据和活动?
客户配置文件数据
| Contacthub | Magento | 注意 |
|---|---|---|
| 标题 | getModel("customer/customer")>getPrefix() | |
| firstName | getModel("customer/customer")>getFirstname() | |
| lastName | getModel("customer/customer")>getLastname() | |
| gender | getModel("customer/customer")>getGender() == 1 ? 'Male' : 'Female' | |
| dob | date('Y-m-d', strtotime(getModel("customer/customer")>$customer>getDob())) | |
| locale | getStoreConfig('general/locale/code', $this>getStoreId()) | |
| contacts.email | getIdentityEmail() | |
| address.street | getModel('customer/address')>getStreet() | 从getDefaultBilling()加载的地址数据 |
| address.city | getModel('customer/address')>getRegion() | 从getDefaultBilling()加载的地址数据 |
| address.country | getModel('directory/country')>load(getModel('customer/address')>getCountry())>getName() | 从getDefaultBilling()加载的地址数据 |
| address.province | getModel('customer/address')>getRegion() | 从getDefaultBilling()加载的地址数据 |
| address.zip | getModel('customer/address')>getPostcode() | 从getDefaultBilling()加载的地址数据 |
活动
| Contacthub | Magento |
|---|---|
| 查看的商品 | 当客户查看一个产品时。 |
| 查看的商品类别 | 当客户查看属于特定类别的商品列表时。 |
| 添加的商品 | 当客户将商品添加到购物车时。 |
| 移除的商品 | 当客户从购物车中移除商品时。 |
| 添加到心愿单的商品 | 当客户将商品添加到他们的心愿单时。 |
| 从心愿单中移除商品 | 当客户从他们的心愿单中移除商品时。 |
| 订单完成 | 当客户完成一个订单时。 |
| 登录 | 当客户登录到他们的账户时。 |
| 登出 | 当客户从他们的账户登出时。 |
| 订阅了新闻通讯 | 当客户订阅您的新闻通讯时。 |
| 退订了新闻通讯 | 当客户退订您的新闻通讯时。 |
| 订单发货 | 当您的公司发货订单中的产品时。 |
| 购物车被遗弃 | 当客户将商品添加到购物车,但没有完成订单/交易时。 |
| Contacthub | Magento | 注意 |
|---|---|---|
| Contacthub | $order->getIncrementId() | |
| 类型 | 销售 | |
| storeCode | $order->getStoreId() | |
| paymentMethod | 不可用 | |
| amount.local.exchangeRate | $order->getStoreToOrderRate() | 这是加载数据时使用的汇率。 |
| amount.local.currency | $order->getOrderCurrencyCode() | |
| amount.total | $order->getGrandTotal() | |
| amount.revenue | $order->getGrandTotal() - $order->getShippingAmount() - $order->getShippingTaxAmount() | |
| amount.shipping | $order->getShippingAmount() + $order->getShippingTaxAmount() | |
| amount.tax | $order->getTaxAmount() | |
| amount.discount | $order->getDiscountAmount() | |
| products.type | 销售 | |
| products.id | $product->getEntityId() | |
| products.sku | $product->getSku() | |
| product.name | $product->getName() | |
| products.linkUrl | Mage::getUrl($product->getUrlPath()) | |
| products.imageUrl | Mage::helper('catalog/image')->init($product, 'image') | |
| products.shortDescription | $product->getShortDescription() | |
| products.category | $this->getCategoryNamesFromIds($product->getCategoryIds()) | |
| products.price | $item->getPrice() | |
| products.subtotal | $item->getRowTotal() | |
| products.quantity | $item->getQtyOrdered() | |
| products.discount | $item->getDiscountAmount() | |
| products.tax | $item->getTaxAmount() | |
| product.coupon | $order->getCouponCode() | |
| context.store.id | Mage::app()->getStore()->getStoreId() | |
| context.store.name | Mage::app()->getStore()->getName() | |
| context.store.country | Mage::getStoreConfig('general/country/default') | |
| context.store.website | Mage::getUrl('', array('store' => Mage::app()->getStore()->getStoreId())) | |
| context.store.type | ECOMMERCE |
重要
在Magento路径中进行的任何自定义设置都不会导出到,或可在Contacthub中使用,因为这些可能会损害插件的运行。