Skip to content

Commit b2c6fa7

Browse files
authored
Rename product to accountType & Added some cookies to the purchase webhook list (#44)
1 parent d86c6ce commit b2c6fa7

File tree

5 files changed

+60
-27
lines changed

5 files changed

+60
-27
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
**Tested up to:** 6.7.1
88

9-
**Stable tag:** 2.1.38
9+
**Stable tag:** 2.1.39
1010

1111
**License:** GPLv2 or later
1212

@@ -85,6 +85,10 @@ Yes. Follow this guide: [How to Setup Facebook Conversion API](https://stape.io/
8585
<details>
8686
<summary>Version 2 changelog</summary>
8787

88+
### 2.1.39
89+
- Rename "product" to "accountType"
90+
- Added some cookies to the purchase webhook list
91+
8892
### 2.1.38
8993
- Added "select_item" event
9094

README.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: gtmserver,bukashk0zzz
33
Tags: google tag manager, google tag manager server side, gtm, gtm server side, tag manager, tagmanager, analytics, google, serverside, server-side, gtag
44
Requires at least: 5.2.0
55
Tested up to: 6.8.0
6-
Stable tag: 2.1.38
6+
Stable tag: 2.1.39
77
License: GPLv2 or later
88
License URI: http://www.gnu.org/licenses/gpl-2.0.html
99

@@ -67,6 +67,10 @@ Yes. <a href="https://stape.io/blog/how-to-set-up-facebook-conversion-api">How t
6767

6868
== Changelog ==
6969

70+
= 2.1.39 =
71+
* Rename "product" to "accountType"
72+
* Added some cookies to the purchase webhook list
73+
7074
= 2.1.38 =
7175
* Added "select_item" event
7276

gtm-server-side.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Plugin Name: Stape Conversion Tracking
1111
* Plugin URI: https://wordpress.org/plugins/gtm-server-side/
1212
* Description: Enhance conversion tracking by implementing server-side tagging using server Google Tag Manager container. Effortlessly configure data layer events in web GTM, send webhooks, set up custom loader, and extend cookie lifetime.
13-
* Version: 2.1.38
13+
* Version: 2.1.39
1414
* Author: Stape
1515
* Author URI: https://stape.io
1616
* License: GPL-2.0+

includes/class-gtm-server-side-handler-data-manager-ingest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ private function get_prepared_destinations() {
180180

181181
if ( ! empty( $option_login_cust_id ) ) {
182182
$req_destinations['linkedAccount'] = array(
183-
'product' => 'GOOGLE_ADS',
184-
'accountId' => $option_login_cust_id,
183+
'accountType' => 'GOOGLE_ADS',
184+
'accountId' => $option_login_cust_id,
185185
);
186186
}
187187

188188
if ( ! empty( $option_oper_cust_id ) ) {
189189
$req_destinations['operatingAccount'] = array(
190-
'product' => 'GOOGLE_ADS',
191-
'accountId' => $option_oper_cust_id,
190+
'accountType' => 'GOOGLE_ADS',
191+
'accountId' => $option_oper_cust_id,
192192
);
193193
}
194194

includes/class-gtm-server-side-helpers.php

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -546,32 +546,57 @@ public static function get_data_layer_event_name( $event_name ) {
546546
*/
547547
public static function get_request_cookies() {
548548
$request_cookies = array(
549-
'_fbp' => filter_input( INPUT_COOKIE, '_fbp', FILTER_DEFAULT ),
550-
'_fbc' => filter_input( INPUT_COOKIE, '_fbc', FILTER_DEFAULT ),
551-
'FPGCLAW' => filter_input( INPUT_COOKIE, 'FPGCLAW', FILTER_DEFAULT ),
552-
'_gcl_aw' => filter_input( INPUT_COOKIE, '_gcl_aw', FILTER_DEFAULT ),
553-
'ttclid' => filter_input( INPUT_COOKIE, 'ttclid', FILTER_DEFAULT ),
554-
'_dcid' => filter_input( INPUT_COOKIE, '_dcid', FILTER_DEFAULT ),
555-
'FPID' => filter_input( INPUT_COOKIE, 'FPID', FILTER_DEFAULT ),
556-
'FPLC' => filter_input( INPUT_COOKIE, 'FPLC', FILTER_DEFAULT ),
557-
'_ttp' => filter_input( INPUT_COOKIE, '_ttp', FILTER_DEFAULT ),
558-
'FPGCLGB' => filter_input( INPUT_COOKIE, 'FPGCLGB', FILTER_DEFAULT ),
559-
'li_fat_id' => filter_input( INPUT_COOKIE, 'li_fat_id', FILTER_DEFAULT ),
560-
'taboola_cid' => filter_input( INPUT_COOKIE, 'taboola_cid', FILTER_DEFAULT ),
561-
'outbrain_cid' => filter_input( INPUT_COOKIE, 'outbrain_cid', FILTER_DEFAULT ),
562-
'impact_cid' => filter_input( INPUT_COOKIE, 'impact_cid', FILTER_DEFAULT ),
563-
'_epik' => filter_input( INPUT_COOKIE, '_epik', FILTER_DEFAULT ),
564-
'_scid' => filter_input( INPUT_COOKIE, '_scid', FILTER_DEFAULT ),
565-
'_scclid' => filter_input( INPUT_COOKIE, '_scclid', FILTER_DEFAULT ),
566-
'_uetmsclkid' => filter_input( INPUT_COOKIE, '_uetmsclkid', FILTER_DEFAULT ),
567-
'_ga' => filter_input( INPUT_COOKIE, '_ga', FILTER_DEFAULT ),
549+
'_fbp' => filter_input( INPUT_COOKIE, '_fbp', FILTER_DEFAULT ),
550+
'_fbc' => filter_input( INPUT_COOKIE, '_fbc', FILTER_DEFAULT ),
551+
'FPGCLAW' => filter_input( INPUT_COOKIE, 'FPGCLAW', FILTER_DEFAULT ),
552+
'_gcl_aw' => filter_input( INPUT_COOKIE, '_gcl_aw', FILTER_DEFAULT ),
553+
'ttclid' => filter_input( INPUT_COOKIE, 'ttclid', FILTER_DEFAULT ),
554+
'_dcid' => filter_input( INPUT_COOKIE, '_dcid', FILTER_DEFAULT ),
555+
'FPID' => filter_input( INPUT_COOKIE, 'FPID', FILTER_DEFAULT ),
556+
'FPLC' => filter_input( INPUT_COOKIE, 'FPLC', FILTER_DEFAULT ),
557+
'_ttp' => filter_input( INPUT_COOKIE, '_ttp', FILTER_DEFAULT ),
558+
'FPGCLGB' => filter_input( INPUT_COOKIE, 'FPGCLGB', FILTER_DEFAULT ),
559+
'li_fat_id' => filter_input( INPUT_COOKIE, 'li_fat_id', FILTER_DEFAULT ),
560+
'taboola_cid' => filter_input( INPUT_COOKIE, 'taboola_cid', FILTER_DEFAULT ),
561+
'outbrain_cid' => filter_input( INPUT_COOKIE, 'outbrain_cid', FILTER_DEFAULT ),
562+
'impact_cid' => filter_input( INPUT_COOKIE, 'impact_cid', FILTER_DEFAULT ),
563+
'_epik' => filter_input( INPUT_COOKIE, '_epik', FILTER_DEFAULT ),
564+
'_scid' => filter_input( INPUT_COOKIE, '_scid', FILTER_DEFAULT ),
565+
'_scclid' => filter_input( INPUT_COOKIE, '_scclid', FILTER_DEFAULT ),
566+
'_uetmsclkid' => filter_input( INPUT_COOKIE, '_uetmsclkid', FILTER_DEFAULT ),
567+
'_ga' => filter_input( INPUT_COOKIE, '_ga', FILTER_DEFAULT ),
568+
'euconsent-v2' => filter_input( INPUT_COOKIE, 'euconsent-v2', FILTER_DEFAULT ),
569+
'addtl_consent' => filter_input( INPUT_COOKIE, 'addtl_consent', FILTER_DEFAULT ),
570+
'usprivacy' => filter_input( INPUT_COOKIE, 'usprivacy', FILTER_DEFAULT ),
571+
'OptanonConsent' => filter_input( INPUT_COOKIE, 'OptanonConsent', FILTER_DEFAULT ),
572+
'CookieConsent' => filter_input( INPUT_COOKIE, 'CookieConsent', FILTER_DEFAULT ),
573+
'didomi_token' => filter_input( INPUT_COOKIE, 'didomi_token', FILTER_DEFAULT ),
574+
'didomi_dcs' => filter_input( INPUT_COOKIE, 'didomi_dcs', FILTER_DEFAULT ),
575+
'axeptio_cookies' => filter_input( INPUT_COOKIE, 'axeptio_cookies', FILTER_DEFAULT ),
576+
'axeptio_authorized_vendors' => filter_input( INPUT_COOKIE, 'axeptio_authorized_vendors', FILTER_DEFAULT ),
577+
'cookieyes-consent' => filter_input( INPUT_COOKIE, 'cookieyes-consent', FILTER_DEFAULT ),
578+
'complianz_consent_status' => filter_input( INPUT_COOKIE, 'complianz_consent_status', FILTER_DEFAULT ),
579+
'borlabs-cookie' => filter_input( INPUT_COOKIE, 'borlabs-cookie', FILTER_DEFAULT ),
580+
'uc_settings' => filter_input( INPUT_COOKIE, 'uc_settings', FILTER_DEFAULT ),
568581
);
569582

570583
if ( ! empty( $_COOKIE ) ) {
571584
$filtered_cookies = array_filter(
572585
$_COOKIE,
573586
function( $key ) {
574-
return preg_match( '/^_ga_.+/', $key );
587+
if ( preg_match( '/^_ga_.+/', $key ) ) {
588+
return true;
589+
}
590+
591+
if ( 0 === strpos( $key, '_iub_cs-' ) ) {
592+
return true;
593+
}
594+
595+
if ( 0 === strpos( $key, 'cmplz_' ) ) {
596+
return true;
597+
}
598+
599+
return false;
575600
},
576601
ARRAY_FILTER_USE_KEY
577602
);

0 commit comments

Comments
 (0)