Plugin Directory

Changeset 2624990


Ignore:
Timestamp:
11/05/2021 09:02:11 AM (4 years ago)
Author:
handcraftbyte
Message:

Switch the monitoring API to edge

Location:
gtm-ecommerce-woo/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • gtm-ecommerce-woo/trunk/gtm-ecommerce-woo.php

    r2618200 r2624990  
    44 * Plugin URI:  https://wordpress.org/plugins/gtm-ecommerce-woo
    55 * Description: Push WooCommerce eCommerce (GA4 and UA compatible) information to GTM DataLayer. Use any GTM integration to measure your customers' activites.
    6  * Version:     1.9.2
     6 * Version:     1.9.3
    77 * Author:      Handcraft Byte
    88 * Author URI:  https://handcraftbyte.com/
  • gtm-ecommerce-woo/trunk/lib/Container.php

    r2615627 r2624990  
    2929        ];
    3030        $tagConciergeApiUrl = getenv('TAG_CONCIERGE_API_URL') ? getenv('TAG_CONCIERGE_API_URL') : 'https://api.tagconcierge.com';
     31        $tagConciergeEdgeUrl = getenv('TAG_CONCIERGE_EDGE_URL') ? getenv('TAG_CONCIERGE_EDGE_URL') : 'https://edge.tagconcierge.com';
    3132
    3233        $wpSettingsUtil = new WpSettingsUtil($snakeCaseNamespace, $spineCaseNamespace);
     
    4748        $this->settingsService = new SettingsService($wpSettingsUtil, $events, $proEvents, $tagConciergeApiUrl, $pluginVersion);
    4849        $this->pluginService = new PluginService($spineCaseNamespace);
    49         $this->monitorService = new MonitorService($snakeCaseNamespace, $spineCaseNamespace, $wcTransformerUtil, $wpSettingsUtil, $wcOutputUtil, $tagConciergeApiUrl);
     50        $this->monitorService = new MonitorService($snakeCaseNamespace, $spineCaseNamespace, $wcTransformerUtil, $wpSettingsUtil, $wcOutputUtil, $tagConciergeApiUrl, $tagConciergeEdgeUrl);
    5051        $this->themeValidatorService = new ThemeValidatorService($snakeCaseNamespace, $spineCaseNamespace, $wcTransformerUtil, $wpSettingsUtil, $wcOutputUtil, $events, $tagConciergeApiUrl);
    5152        $this->eventInspectorService = new EventInspectorService($wpSettingsUtil);
  • gtm-ecommerce-woo/trunk/lib/Service/MonitorService.php

    r2615627 r2624990  
    1414    protected $wcTransformerUtil;
    1515    protected $tagConciergeApiUrl;
    16 
    17     public function __construct( $snakeCaseNamespace, $spineCaseNamespace, $wcTransformerUtil, $wpSettingsUtil, $wcOutputUtil, $tagConciergeApiUrl) {
     16    protected $tagConciergeEdgeUrl;
     17
     18    public function __construct( $snakeCaseNamespace, $spineCaseNamespace, $wcTransformerUtil, $wpSettingsUtil, $wcOutputUtil, $tagConciergeApiUrl, $tagConciergeEdgeUrl) {
    1819        $this->snakeCaseNamespace = $snakeCaseNamespace;
    1920        $this->spineCaseNamespace = $spineCaseNamespace;
     
    2223        $this->wcOutputUtil = $wcOutputUtil;
    2324        $this->tagConciergeApiUrl = $tagConciergeApiUrl;
     25        $this->tagConciergeEdgeUrl = $tagConciergeEdgeUrl;
    2426    }
    2527
     
    6668        echo "(function(dataLayer) {\n";
    6769        echo "dataLayer.push({ uuid_hash: '" . $this->hash($uuid) . "' });";
    68         echo "dataLayer.push({ monitor_url: '" . $this->tagConciergeApiUrl . "' });";
     70        echo "dataLayer.push({ monitor_url: '" . $this->tagConciergeEdgeUrl . "' });";
    6971        echo '})(dataLayer);';
    7072        echo "</script>\n";
     
    116118        ];
    117119
    118         $response = wp_remote_post( $this->tagConciergeApiUrl . '/v2/monitor/transactions', $args );
     120        try {
     121            $response = wp_remote_post( $this->tagConciergeEdgeUrl . '/v2/monitor/transactions', $args );
     122        } catch (Exception $err) {
     123            error_log( 'Tag Concierge Monitor add_to_cart failed' );
     124        }
    119125    }
    120126
     
    144150
    145151        try {
    146             $response = wp_remote_post( $this->tagConciergeApiUrl . '/v2/monitor/events', $args );
     152            $response = wp_remote_post( $this->tagConciergeEdgeUrl . '/v2/monitor/events', $args );
    147153        } catch (Exception $err) {
    148154            error_log( 'Tag Concierge Monitor add_to_cart failed' );
     
    182188        ];
    183189        try {
    184             $response = wp_remote_post( $this->tagConciergeApiUrl . '/v2/monitor/events', $args );
     190            $response = wp_remote_post( $this->tagConciergeEdgeUrl . '/v2/monitor/events', $args );
    185191        } catch (Exception $err) {
    186192            error_log( 'Tag Concierge Monitor purchase failed' );
  • gtm-ecommerce-woo/trunk/readme.txt

    r2618200 r2624990  
    118118== Changelog ==
    119119
     120= 1.9.3 =
     121
     122* switch the monitoring API to edge endpoints for performance gains
     123
    120124= 1.9.2 =
    121125
Note: See TracChangeset for help on using the changeset viewer.