[WordPress] 外掛分享: WP Mautic

首頁外掛目錄 › WP Mautic
WordPress 外掛 WP Mautic 的封面圖片
6,000+
安裝啟用
★★★★
4.9/5 分(8 則評價)
20 天前
最後更新
問題解決
WordPress 4.6+ v2.5.1 上架:2015-02-26

內容簡介

Mautic WordPress 外掛會在 WP 網站中注入 Mautic 追蹤腳本和圖片。您的 Mautic 實例可以追蹤有關訪問者的信息。您也可以使用不同的短碼在您的網站中插入 Mautic 內容。

關鍵功能

您不需要編輯模板的原始代碼來插入追蹤代碼。
外掛將附加信息添加到追蹤圖像 URL 中,因此使用追蹤圖像的純 HTML 代碼比使用普通 HTML 代碼獲得更好的結果。
您可以使用以下短碼插入 Mautic 表單。
您可以選擇腳本的注入位置(標頭/腳注)。
當 JavaScript 被禁用時,可以使用追蹤圖像作為備用方法。

配置

安裝完成後,外掛程式必須出現在您的外掛程式列表中:

啟用它。
轉到設置頁面,並設置您的 Mautic 實例 URL。

這就是全部!

使用方式
Mautic 追蹤腳本

在完成配置步驟後,追蹤腳本即可正常運作。這意味著它會從您的 Mautic 實例中插入 mtc.js 腳本。您可以檢查您的 WP 網站的 HTML 源代碼(Ctrl + U)來確保外掛程式正常運作。您應該能夠找到類似以下內容的內容:

<script>
(function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
})(window,document,'script','http://yourmauticsite.com/mtc.js','mt');

wpmautic_send();
</script>

自定義屬性處理

如果您需要在 Mautic 事件中發送自定義屬性,您可以使用 wpmautic_tracking_attributes 過濾器。

add_filter('wpmautic_tracking_attributes', function($attrs) {
$attrs['preferred_locale'] = $customVar;
return $attrs;
});

返回的屬性將添加到 Mautic 載荷中。

Mautic 表單

要在 WP 帖子中載入 Mautic 表單,在您想要出現表單的位置插入以下短碼:

[mautic type="form" id="1"]

將“1”替換為您要載入的表單 ID。要獲得表單的 ID,轉到 Mautic,打開表單詳細信息,查看 URL。ID 就在那裡。例如,在此 URL 中:http://yourmautic.com/s/forms/view/3,ID 為 3。

Mautic 集中式關注

要在您的帖子中載入 Mautic 集中式關注,請在您希望出現表格的位置插入以下短碼:

[mautic type="focus" id="1"]

將“1”替換為您要載入的焦點 ID。要獲取焦點的 ID,轉到您的 Mautic,打開關注詳細信息,並查看 URL。ID 就在那裡。例如,在此 URL 中:http://yourmautic.com/s/focus/3.js,ID 為 3。

Mautic 動態內容

要在您的 WP 內容中載入動態內容,請在您想要出現的位置插入以下短碼:

[mautic type="content" slot="slot_name"]Default content to display in case of error or unknown contact.[/mautic]

用“slot_name”替換要載入的插槽名稱。這對應於在構建您的運營活動並添加“請求動態內容”聯繫決策時定義的插槽名稱。

Mautic 通行視頻

Mautic 支持使用 Youtube、Vimeo 和 MP4 作為源的通行視頻。

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.5.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「WP Mautic」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Mautic WordPress Plugin injects Mautic tracking script and image in the WP website. Your Mautic instance will be able to track information about your visitors. You can also insert Mautic content inside your website using different shortcodes.
Key features

You don’t have to edit source code of your template to insert tracking code.
Plugin adds additional information to tracking image URL so you get better results than using just plain HTML code of tracking image.
You can use Mautic form embed with shortcode described below.
You can choose where the script is injected (header / footer).
Tracking image can be used as fallback when JavaScript is disabled.

Configuration
Once installed, the plugin must appared in your plugin list :

Enable it.
Go to the settings page and set your Mautic instance URL.

And that’s it !
Usage
Mautic Tracking Script
Tracking script works right after you finish the configuration steps. That means it will insert the mtc.js script from your Mautic instance. You can check HTML source code (CTRL + U) of your WP website to make sure the plugin works. You should be able to find something like this:

Custom attributes handling
If you need to send custom attributes within Mautic events, you can use the wpmautic_tracking_attributes filter.
add_filter('wpmautic_tracking_attributes', function($attrs) {
$attrs['preferred_locale'] = $customVar;
return $attrs;
});

The returned attributes will be added to Mautic payload.
Mautic Forms
To load a Mautic Form to your WP post, insert this shortcode to the place you want the form to appear:
[mautic type="form" id="1"]

Replace “1” with the form ID you want to load. To get the ID of the form, go to your Mautic, open the form detail and look at the URL. The ID is right there. For example in this URL: http://yourmautic.com/s/forms/view/3 the ID is 3.
Mautic Focus
To load a Mautic Focus to your post, insert this shortcode to the place you want the form to appear:
[mautic type="focus" id="1"]

Replace “1” with the focus ID you want to load. To get the ID of the focus, go to your Mautic, open the focus detail and look at the URL. The ID is right there. For example in this URL: http://yourmautic.com/s/focus/3.js the ID is 3.
Mautic Dynamic Content
To load dynamic content into your WP content, insert this shortcode where you’d like it to appear:
[mautic type="content" slot="slot_name"]Default content to display in case of error or unknown contact.[/mautic]

Replace the “slot_name” with the slot name you’d like to load. This corresponds to the slot name you defined when building your campaign and adding the “Request Dynamic Content” contact decision.
Mautic Gated Videos
Mautic supports gated videos with Youtube, Vimeo, and MP4 as sources.
To load gated videos into your WP content, insert this shortcode where you’d like it to appear:
[mautic type="video" gate-time="#" form-id="#" src="URL"]
[mautic type="video" src="URL"]

Replace the # signs with the appropriate number. For gate-time, enter the time (in seconds) where you want to pause the video and show the mautic form. For form-id, enter the id of the mautic form that you’d like to display as the gate. Replace URL with the browser URL to view the video. In the case of Youtube or Vimeo, you can simply use the URL as it appears in your address bar when viewing the video normally on the providing website. For MP4 videos, enter the full http URL to the MP4 file on the server.
Since the Mautic v2.9.1 release, the form-id is not mandatory anymore, mautic video can be tracked.
Mautic Tags
You can add or remove multiple lead tags on specific pages using commas. To remove an tag you have to use minus “-” signal before tag name:
[mautic type="tags" values="mytag,anothertag,-removetag"]

延伸相關外掛

文章
Filter
Mastodon