diff --git a/CHANGELOG b/CHANGELOG
index 897d381..6151247 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,8 @@
# Changelog
+## 2.4.2
+* UPDATE: Add admin option to enable/disable ListHub analytics test events.
+
## 2.4.1
* FIX: Update responsive media queries for bigger mobile device screen sizes.
diff --git a/readme.txt b/readme.txt
index 9278740..c6389f4 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Contributors: SimplyRETS
Tags: rets, idx, real estate listings, real estate, listings, rets listings, simply rets, realtor, rets feed, idx feed
Requires at least: 3.0.1
Tested up to: 4.9.4
-Stable tag: 2.4.1
+Stable tag: 2.4.2
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -235,6 +235,9 @@ listing sidebar widget.
== Changelog ==
+= 2.4.2 =
+* UPDATE: Add admin option to enable/disable ListHub analytics test events.
+
= 2.4.1 =
* FIX: Update responsive media queries for bigger mobile device screen sizes.
diff --git a/simply-rets-admin.php b/simply-rets-admin.php
index 4e94fd4..ecf703e 100644
--- a/simply-rets-admin.php
+++ b/simply-rets-admin.php
@@ -36,6 +36,7 @@ function register_admin_settings() {
register_setting('sr_admin_settings', 'sr_additional_rooms');
register_setting('sr_admin_settings', 'sr_listhub_analytics');
register_setting('sr_admin_settings', 'sr_listhub_analytics_id');
+ register_setting('sr_admin_settings', 'sr_listhub_analytics_test_events');
register_setting('sr_admin_settings', 'sr_search_map_position');
register_setting('sr_admin_settings', 'sr_permalink_structure');
register_setting('sr_admin_settings', 'sr_google_api_key');
@@ -484,6 +485,17 @@ function sr_admin_page() {
+
+
+
+ |
+
Metrics Provider ID (provided by Listhub)
diff --git a/simply-rets-api-helper.php b/simply-rets-api-helper.php
index 0d4374b..cad536a 100644
--- a/simply-rets-api-helper.php
+++ b/simply-rets-api-helper.php
@@ -90,7 +90,7 @@ public static function srApiOptionsRequest( $url ) {
$php_version = phpversion();
$site_url = get_site_url();
- $ua_string = "SimplyRETSWP/2.4.1 Wordpress/{$wp_version} PHP/{$php_version}";
+ $ua_string = "SimplyRETSWP/2.4.2 Wordpress/{$wp_version} PHP/{$php_version}";
$accept_header = "Accept: application/json; q=0.2, application/vnd.simplyrets-v0.1+json";
if( is_callable( 'curl_init' ) ) {
@@ -209,7 +209,7 @@ public static function srApiRequest( $url ) {
$wp_version = get_bloginfo('version');
$php_version = phpversion();
- $ua_string = "SimplyRETSWP/2.4.1 Wordpress/{$wp_version} PHP/{$php_version}";
+ $ua_string = "SimplyRETSWP/2.4.2 Wordpress/{$wp_version} PHP/{$php_version}";
$accept_header = "Accept: application/json; q=0.2, application/vnd.simplyrets-v0.1+json";
if( is_callable( 'curl_init' ) ) {
@@ -873,15 +873,19 @@ public static function srResidentialDetailsGenerator( $listing ) {
* Check for ListHub Analytics
*/
if( get_option( 'sr_listhub_analytics' ) ) {
+
$lh_analytics = SimplyRetsApiHelper::srListhubAnalytics();
- if( get_option( 'sr_listhub_analytics_id' ) ) {
- $metrics_id = get_option( 'sr_listhub_analytics_id' );
+ $lh_id = get_option('sr_listhub_analytics_id', false);
+ $lh_test = get_option('sr_listhub_analytics_test_events') ? 1 : false;
+
+ if($lh_id) {
$lh_send_details = SimplyRetsApiHelper::srListhubSendDetails(
- $metrics_id
- , true
+ $lh_id
+ , $lh_test
, $listing_mlsid
, $postal_code
);
+
$lh_analytics .= $lh_send_details;
}
} else {
@@ -1731,7 +1735,7 @@ public static function srListhubAnalytics() {
public static function srListhubSendDetails( $m, $t, $mlsid, $zip=NULL ) {
$metrics_id = $m;
- $test = $t;
+ $test = json_encode($t);
$mlsid = $mlsid;
$zipcode = $zip;
diff --git a/simply-rets.php b/simply-rets.php
index 84206de..e18c017 100644
--- a/simply-rets.php
+++ b/simply-rets.php
@@ -4,7 +4,7 @@
Plugin URI: https://simplyrets.com
Description: Show your Real Estate listings on your Wordpress site. SimplyRETS provides a very simple set up and full control over your listings.
Author: SimplyRETS
-Version: 2.4.1
+Version: 2.4.2
License: GNU General Public License v3 or later
Copyright (c) SimplyRETS 2014 - 2015
|