开发者 | lumpysimon |
---|---|
更新时间 | 2016年4月20日 07:07 |
捐献地址: | 去捐款 |
PHP版本: | 3.8 及以上 |
WordPress版本: | 4.5 |
Take a look at https://intercom.io, they explain it better than I can!
No, it only tracks logged-in users. The administrator is not tracked.
Simply add the hide_from_intercom
capability to the user role.
The following example will exclude editors, you should put this code in your theme's functions.php or a plugin:
$role = get_role( 'editor' ); $role->add_cap( 'hide_from_intercom' );
Yes, you can choose between "Firstname Lastname" or the user's displayname.
Yes, on the options screen you can choose to send the user's role and/or website URL.
Yes, there is a filter called ll_intercom_custom_data
that you can use to filter the $custom
array. For each extra custom user attribute you wish to send, you should add a key => value array element (e.g. Age => 42
).
Here's an example that sends the user's age based on the value in a usermeta field. This code should be placed in your theme's functions.php file or in a plugin:
`
add_filter( 'll_intercom_custom_data', 'my_intercom_data' );
function my_intercom_data( $custom ) {
$user_id = get_current_user_id();
if ( $age = get_user_meta( $user_id, 'age', true ) ) {
$custom['Age'] = $age ;
}
return $custom;
}
`
Make sure you read Intercom's custom user attributes documentation.
Yes, you can add this using the ll_intercom_company_data
filter. Your function should return the company data as an array. Here's a simple example:
`
add_filter( 'll_intercom_company_data', 'my_intercom_company_data' );
function my_intercom_company_data() {
$company = array(
'id' => 100,
'name' => 'My Cool Company',
'created_at' => strtotime( '10 June 2011' )
);
return $company;
}
`
Please read Intercom's company data documentation.
This plugin uses Intercom's default 'activator', but you can use your own one via the ll_intercom_activator
filter.
Here's an example that uses all links with the my-activator
class:
`
add_filter( 'll_intercom_activator', 'my_intercom_activator' );
function my_intercom_activator( $activator ) {
return '.my-activator';
}
`
Sure, just use the ll_intercom_output_snippet
filter. Here's an example:
`
add_filter( 'll_intercom_output_snippet', 'no_intercom_on_page_10' );
function no_intercom_on_page_10( $show ) {
if ( is_page( 10 ) )
return false;
return true;
}
`
It is highly recommended to enable Intercom's "secure mode". All communications between your website and Intercom will then use a secret key to generate a 'hash' with every request - this prevents users maliciously sending messages as another user. Please read Intercom's secure mode documentation.
Possibly, but I've not tried. I can only provide support if you're using the latest version of this plugin together with the latest version of WordPress and PHP 5.2.4 or newer.