Changeset 3418577
- Timestamp:
- 12/12/2025 11:02:10 PM (2 months ago)
- Location:
- optincraft
- Files:
-
- 6 edited
- 1 copied
-
tags/0.1.6 (copied) (copied from optincraft/trunk)
-
tags/0.1.6/app/Http/Controllers/EventsController.php (modified) (8 diffs)
-
tags/0.1.6/optincraft.php (modified) (1 diff)
-
tags/0.1.6/readme.txt (modified) (2 diffs)
-
trunk/app/Http/Controllers/EventsController.php (modified) (8 diffs)
-
trunk/optincraft.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
optincraft/tags/0.1.6/app/Http/Controllers/EventsController.php
r3384849 r3418577 40 40 public function ingest( Validator $validator, WP_REST_Request $request ): array { 41 41 $event_type = $request->get_param( 'event_type' ); 42 $country = optincraft_get_user_country_code(); 42 43 43 44 // Handle page views separately (global, not campaign-specific) 44 45 if ( $event_type === 'view' ) { 45 return $this->ingest_page_view( $validator, $request );46 return $this->ingest_page_view( $validator, $request, $country ); 46 47 } 47 48 48 49 // Handle campaign-specific events (impression, conversion, revenue) 49 return $this->ingest_campaign_event( $validator, $request );50 return $this->ingest_campaign_event( $validator, $request, $country ); 50 51 } 51 52 … … 53 54 * Ingest a page view event (global, not campaign-specific). 54 55 */ 55 private function ingest_page_view( Validator $validator, WP_REST_Request $request ): array {56 private function ingest_page_view( Validator $validator, WP_REST_Request $request, $country ): array { 56 57 // Validate page view data 57 58 $validator->validate( … … 61 62 'device' => 'string|accepted:desktop,mobile,tablet', 62 63 'browser' => 'string', 63 'country' => 'string',64 64 'visitor_id' => 'string', 65 65 'session_id' => 'string', … … 73 73 // 'device' => $request->get_param( 'device' ), 74 74 // 'browser' => $request->get_param( 'browser' ), 75 // 'country_code' => $ request->get_param( 'country' ),75 // 'country_code' => $country, 76 76 // 'visitor_id' => $request->get_param( 'visitor_id' ), 77 77 // 'session_id' => $request->get_param( 'session_id' ), … … 84 84 ->set_device( $request->get_param( 'device' ) ) 85 85 ->set_browser( $request->get_param( 'browser' ) ) 86 ->set_country_code( $ request->get_param( 'country' ))86 ->set_country_code( $country ) 87 87 ->set_visitor_id( $request->get_param( 'visitor_id' ) ) 88 88 ->set_session_id( $request->get_param( 'session_id' ) ); … … 99 99 * Ingest a campaign-specific event (impression, conversion, revenue). 100 100 */ 101 private function ingest_campaign_event( Validator $validator, WP_REST_Request $request ): array {101 private function ingest_campaign_event( Validator $validator, WP_REST_Request $request, $country ): array { 102 102 $validator->validate( 103 103 [ … … 108 108 'device' => 'string|accepted:desktop,mobile,tablet', 109 109 'browser' => 'string', 110 'country' => 'string',111 110 'revenue' => 'numeric', 112 111 'visitor_id' => 'string', … … 123 122 'device' => $request->get_param( 'device' ), 124 123 'browser' => $request->get_param( 'browser' ), 125 'country_code' => $ request->get_param( 'country' ),124 'country_code' => $country, 126 125 'revenue' => $request->get_param( 'revenue' ) ?: 0, 127 126 'visitor_id' => $request->get_param( 'visitor_id' ), -
optincraft/tags/0.1.6/optincraft.php
r3417039 r3418577 9 9 * Plugin Name: OptinCraft 10 10 * Description: The Powerful Drag & Drop Popup Builder for WordPress 11 * Version: 0.1. 511 * Version: 0.1.6 12 12 * Requires at least: 6.5 13 13 * Requires PHP: 7.4 -
optincraft/tags/0.1.6/readme.txt
r3417039 r3418577 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 0.1. 57 Stable tag: 0.1.6 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 177 177 178 178 == Changelog == 179 = 0.1.6(beta) - 13 December 2025 = 180 * Fixed: Country analytics not showing issue. 181 179 182 = 0.1.5(beta) - 11 December 2025 = 180 183 * New: Added option to hide element for specific devices. -
optincraft/trunk/app/Http/Controllers/EventsController.php
r3384849 r3418577 40 40 public function ingest( Validator $validator, WP_REST_Request $request ): array { 41 41 $event_type = $request->get_param( 'event_type' ); 42 $country = optincraft_get_user_country_code(); 42 43 43 44 // Handle page views separately (global, not campaign-specific) 44 45 if ( $event_type === 'view' ) { 45 return $this->ingest_page_view( $validator, $request );46 return $this->ingest_page_view( $validator, $request, $country ); 46 47 } 47 48 48 49 // Handle campaign-specific events (impression, conversion, revenue) 49 return $this->ingest_campaign_event( $validator, $request );50 return $this->ingest_campaign_event( $validator, $request, $country ); 50 51 } 51 52 … … 53 54 * Ingest a page view event (global, not campaign-specific). 54 55 */ 55 private function ingest_page_view( Validator $validator, WP_REST_Request $request ): array {56 private function ingest_page_view( Validator $validator, WP_REST_Request $request, $country ): array { 56 57 // Validate page view data 57 58 $validator->validate( … … 61 62 'device' => 'string|accepted:desktop,mobile,tablet', 62 63 'browser' => 'string', 63 'country' => 'string',64 64 'visitor_id' => 'string', 65 65 'session_id' => 'string', … … 73 73 // 'device' => $request->get_param( 'device' ), 74 74 // 'browser' => $request->get_param( 'browser' ), 75 // 'country_code' => $ request->get_param( 'country' ),75 // 'country_code' => $country, 76 76 // 'visitor_id' => $request->get_param( 'visitor_id' ), 77 77 // 'session_id' => $request->get_param( 'session_id' ), … … 84 84 ->set_device( $request->get_param( 'device' ) ) 85 85 ->set_browser( $request->get_param( 'browser' ) ) 86 ->set_country_code( $ request->get_param( 'country' ))86 ->set_country_code( $country ) 87 87 ->set_visitor_id( $request->get_param( 'visitor_id' ) ) 88 88 ->set_session_id( $request->get_param( 'session_id' ) ); … … 99 99 * Ingest a campaign-specific event (impression, conversion, revenue). 100 100 */ 101 private function ingest_campaign_event( Validator $validator, WP_REST_Request $request ): array {101 private function ingest_campaign_event( Validator $validator, WP_REST_Request $request, $country ): array { 102 102 $validator->validate( 103 103 [ … … 108 108 'device' => 'string|accepted:desktop,mobile,tablet', 109 109 'browser' => 'string', 110 'country' => 'string',111 110 'revenue' => 'numeric', 112 111 'visitor_id' => 'string', … … 123 122 'device' => $request->get_param( 'device' ), 124 123 'browser' => $request->get_param( 'browser' ), 125 'country_code' => $ request->get_param( 'country' ),124 'country_code' => $country, 126 125 'revenue' => $request->get_param( 'revenue' ) ?: 0, 127 126 'visitor_id' => $request->get_param( 'visitor_id' ), -
optincraft/trunk/optincraft.php
r3417039 r3418577 9 9 * Plugin Name: OptinCraft 10 10 * Description: The Powerful Drag & Drop Popup Builder for WordPress 11 * Version: 0.1. 511 * Version: 0.1.6 12 12 * Requires at least: 6.5 13 13 * Requires PHP: 7.4 -
optincraft/trunk/readme.txt
r3417039 r3418577 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 0.1. 57 Stable tag: 0.1.6 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 177 177 178 178 == Changelog == 179 = 0.1.6(beta) - 13 December 2025 = 180 * Fixed: Country analytics not showing issue. 181 179 182 = 0.1.5(beta) - 11 December 2025 = 180 183 * New: Added option to hide element for specific devices.
Note: See TracChangeset
for help on using the changeset viewer.