Forum Replies Created

Viewing 15 replies - 1 through 15 (of 363 total)
  • Thread Starter Nicola Modugno

    (@shark986)

    Thank you, Leonardo. I’m really sorry to bother you, but as you can imagine, I need to understand how to proceed for my client. Before writing anything, I verify what I say, so I confirm that I have seen those files and also the bannercookie.php file (which is the new template file), and that’s exactly why I don’t understand how that file can modify the plugin’s logic.

    The template in question rewrites the “functional” and “statistics” cookie sections by adding the strings “Always active.” However, this is purely a graphical modification, without any logical changes.
    Are there any “backstage procedures” that check the template content and adjust the plugin’s logic accordingly, or what?

    Thread Starter Nicola Modugno

    (@shark986)

    Leonardo,
    the guide you pointed out does not suggest any changes to the plugin configuration; it only says to load the linked must-use plugin.

    The plugin contains:
    1) the startup file, which
    — 1.1) modifies the path of the cookie banner template
    — 1.2) allows adding custom CSS
    — 1.3) saves the banner at every WordPress startup (code to be removed in production)
    2) the custom template

    Could you please indicate how the plugin logic is modified?
    We are probably referring to different guides/plugins because something doesn’t add up.

    Thank you.

    Thread Starter Nicola Modugno

    (@shark986)

    Thank you, Leonardo,

    The thing I don’t understand is: how can the logic of the plugin be modified since the proposed modification in the guide only modifies a template and not plugin files or anything else?

    I hope you can give me some more details, and I thank you for your availability.

    Thread Starter Nicola Modugno

    (@shark986)

    Hi Leonardo, thank you for your response.

    As the guide itself states, in some countries anonymized statistics are allowed without prior consent.
    Through the guide, the banner template is replaced, making the string “Always active” visible instead of the checkbox.

    So, I ask you: If I apply the customized template, what happens when the visit comes from one of those countries where consent for statistical cookies (even if anonymized) is required? Does the banner show “Always active” but the cookies remain blocked? Or does the template modification change the logical behavior of the plugin, and therefore the statistical cookies are always released?

    Ideally, the string “Always active” should appear when the visit does NOT come from one of those countries where prior consent is mandatory; otherwise, the checkbox should still be shown to allow the user to give or deny consent.
    Is it already like this, or can you give me some suggestions on this matter?

    Thank you for your support.

    Thread Starter Nicola Modugno

    (@shark986)

    Thank you for your responses.

    The idea is to add a “preload link” header to the response header.

    @serpentdriver the browser knows if a resources has been already downloaded/cached, so, even if I add a preload header, it would not download the resources again. Or I am missing something?
    I think that a drawback could be the header size: could it be a problem?

    @qtwrk I saw that filter. Is there somewhere a reference to the resources? Or a LS function that returns the URI of an optimized JS file (for example, for the images I know the \LiteSpeed\Media\webp_url() function)? Otherwise I will scan the page searching for the resources but I am worried about server load…

    Nicola

    Thread Starter Nicola Modugno

    (@shark986)

    @serpentdriver, now your answer pointed me in the right direction:
    Knowing that the problem is already managed by the LS plugin, I have checked the configuration for the webp replacement and refreshed the whole cache. The problem seems to be solved now.

    Maybe the cache of some pages was created before the webp replacement was enabled (due to the domain token of quic.cloud not already confirmed).

    Thank you for your time!

    Thread Starter Nicola Modugno

    (@shark986)

    Hello @serpentdriver, thank you for your reply.

    Yes, these users get .jpegs or .png

    If you consider that we are talking about the LS plugin, and that the plugin substitutes the original image src with the webp version, you can think that NO, users are not able to get the original images unless someone tell their browser how to do!
    I think it is clear: I am asking if the LS plugin (that, remember, substitutes the images src) can also automatically manage the “Safari problem” or there is a workaround for that.

    More data to load, because most jpg or png have a higher file size.

    There are no valid statistics, but maybe Google knows it.

    Please, read my post in the right order, from top to bottom: I am not referring to technical aspects, but I am asking if there are statistics on how many users use Safari with older OS, or If someone from the LS staff can share some details or sources to get the right problem dimensions.

    Have a nice day.

    Thread Starter Nicola Modugno

    (@shark986)

    Hello qtwrk!

    I rolled back my code to have the standard response.
    When I leave a review (remember that we are on woocommerce product pages):

    -> POST to wp-comments-post.php
    Request headers:

    
    :authority: www.________.com
    :method: POST
    :path: /wp-comments-post.php
    :scheme: https
    accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    accept-encoding: gzip, deflate, br
    accept-language: it-IT,it;q=0.9
    cache-control: no-cache
    content-length: 173
    content-type: application/x-www-form-urlencoded
    cookie: _ga=GA1.2.1____; _gid=GA1.2.____; wp-wpml_current_language=it; cmplz_saved_categories=["functional"]; cmplz_saved_services={}; cmplz_id=24226; _gat=1; wp_woocommerce_session__________=t_5b2c7____; ls_smartpush=400003; _gali=submit
    origin: https://www.________.com
    pragma: no-cache
    referer: https://www.________.com/shop/category/product/
    sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"
    sec-ch-ua-mobile: ?0
    sec-ch-ua-platform: "macOS"
    sec-fetch-dest: document
    sec-fetch-mode: navigate
    sec-fetch-site: same-origin
    sec-fetch-user: ?1
    upgrade-insecure-requests: 1
    user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36
    

    Response headers, with 302 status code:

    
    cache-control: no-cache, no-store, must-revalidate, max-age=0
    content-length: 0
    content-type: text/html; charset=UTF-8
    date: Wed, 08 Jun 2022 07:34:13 GMT
    expires: Wed, 11 Jan 1984 05:00:00 GMT
    location: https://www.________.com/shop/category/product/?unapproved=78375&moderation-hash=9dda8229d891b8a7385d5866536470cb#comment-78375
    server: LiteSpeed
    set-cookie: comment_author_16ff2f55e1______=+; expires=Tue, 08-Jun-2021 07:34:13 GMT; Max-Age=0; path=/; secure
    set-cookie: comment_author_email_16ff2f55e19b8c6_______=+; expires=Tue, 08-Jun-2021 07:34:13 GMT; Max-Age=0; path=/; secure
    set-cookie: comment_author_url_16ff2f55e19b_______=+; expires=Tue, 08-Jun-2021 07:34:13 GMT; Max-Age=0; path=/; secure
    set-cookie: _lscache_vary=commenter; expires=Sun, 21-May-2023 12:54:13 GMT; Max-Age=30000000; path=/shop/category/product/; secure; HttpOnly
    set-cookie: wp_automatewoo_visitor_16ff2f55e______; expires=Thu, 08-Jun-2023 07:34:13 GMT; Max-Age=31536000; path=/; secure
    set-cookie: wp_automatewoo_session_started=1; path=/; secure
    strict-transport-security: max-age=31536000; includeSubDomains; preload
    vary: User-Agent
    x-content-type-options: nosniff
    x-dns-prefetch-control: on
    x-frame-options: SAMEORIGIN
    x-litespeed-cache-control: no-cache
    x-litespeed-tag: d83_HTTP.302
    x-powered-by: PHP/7.3.27
    x-redirect-by: WordPress
    x-xss-protection: 1; mode=block
    

    -> GET to https://www.________.com/shop/category/product/?unapproved=78375&moderation-hash=9dda8229d891b8a7385d5866536470cb#comment-78375
    Request headers:

    
    :authority: www.________.com
    :method: GET
    :path: /shop/category/product/?unapproved=78375&moderation-hash=9dda8229d891b8a7385d5866536470cb
    :scheme: https
    accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    accept-encoding: gzip, deflate, br
    accept-language: it-IT,it;q=0.9
    cache-control: no-cache
    cookie: _lscache_vary=commenter; _ga=GA1.2.____; _gid=GA1.2____; wp-wpml_current_language=it; cmplz_saved_categories=["functional"]; cmplz_saved_services={}; cmplz_id=24226; _gat=1; wp_woocommerce_session_16ff2f55e19b8c61_________=________________; ls_smartpush=400003; _gali=submit; wp_automatewoo_visitor_16ff2f55e19b8c61_________=u1dk________; wp_automatewoo_session_started=1
    pragma: no-cache
    referer: https://www.________.com/shop/category/product/
    sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"
    sec-ch-ua-mobile: ?0
    sec-ch-ua-platform: "macOS"
    sec-fetch-dest: document
    sec-fetch-mode: navigate
    sec-fetch-site: same-origin
    sec-fetch-user: ?1
    upgrade-insecure-requests: 1
    user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36
    

    Response headers, with 200 status code:

    
    cache-control: max-age=600, must-revalidate
    content-encoding: br
    content-type: text/html; charset=UTF-8
    date: Wed, 08 Jun 2022 07:34:15 GMT
    expires: Wed, 08 Jun 2022 07:44:14
    link: <https://www.________.com/wp-content/uploads/2016/10/Logo-rosso.png>; rel=preload; as=image
    link: <https://www.________.com/wp-json/>; rel="https://api.w.org/"
    link: <https://www.________.com/wp-json/wp/v2/product/22680>; rel="alternate"; type="application/json"
    link: <https://www.________.com/?p=22680>; rel=shortlink
    server: LiteSpeed
    set-cookie: _lscache_vary=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/shop/category/product/; secure; HttpOnly
    strict-transport-security: max-age=31536000; includeSubDomains; preload
    vary: Accept-Encoding,User-Agent
    x-content-type-options: nosniff
    x-dns-prefetch-control: on
    x-frame-options: SAMEORIGIN
    x-litespeed-cache-control: no-cache
    x-litespeed-tag: d83_HTTP.200
    x-powered-by: PHP/7.3.27
    x-xss-protection: 1; mode=block
    

    I restored my code, also, and did another test:

    -> POST to wp-comments-post.php
    Request headers:

    
    :authority: www.________.com
    :method: POST
    :path: /wp-comments-post.php
    :scheme: https
    accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    accept-encoding: gzip, deflate, br
    accept-language: it-IT,it;q=0.9
    cache-control: no-cache
    content-length: 173
    content-type: application/x-www-form-urlencoded
    cookie: _ga=GA1.2.1154651686.1654674501; _gid=GA1.2______; wp-wpml_current_language=it; _gat=1; cmplz_saved_categories=["functional"]; cmplz_saved_services={}; cmplz_id=24229; wp_woocommerce_session_16ff2________=t_fbbf14e42d1b9f3428a05b8________________; ls_smartpush=4000003; _gali=submit
    origin: https://www.________.com
    pragma: no-cache
    referer: https://www.________.com/shop/category/product/
    sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"
    sec-ch-ua-mobile: ?0
    sec-ch-ua-platform: "macOS"
    sec-fetch-dest: document
    sec-fetch-mode: navigate
    sec-fetch-site: same-origin
    sec-fetch-user: ?1
    upgrade-insecure-requests: 1
    user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36
    

    Response headers, with 302 status code:

    
    cache-control: no-cache, no-store, must-revalidate, max-age=0
    content-length: 0
    content-type: text/html; charset=UTF-8
    date: Wed, 08 Jun 2022 07:48:54 GMT
    expires: Wed, 11 Jan 1984 05:00:00 GMT
    location: https://www.________.com/shop/category/product/?unapproved=78377&moderation-hash=a7a3c753ba6dedc641974f63cb847317#comment-78377
    server: LiteSpeed
    set-cookie: comment_author_16ff2________=+; expires=Tue, 08-Jun-2021 07:48:54 GMT; Max-Age=0; path=/; secure
    set-cookie: comment_author_email_16ff2________=+; expires=Tue, 08-Jun-2021 07:48:54 GMT; Max-Age=0; path=/; secure
    set-cookie: comment_author_url_16ff2________=+; expires=Tue, 08-Jun-2021 07:48:54 GMT; Max-Age=0; path=/; secure
    set-cookie: _lscache_vary=commenter; expires=Sun, 21-May-2023 13:08:54 GMT; Max-Age=30000000; path=/shop/category/product/; secure; HttpOnly
    set-cookie: wp_automatewoo_visitor_16ff2________=u1dk8dgx38itr10bve63; expires=Thu, 08-Jun-2023 07:48:54 GMT; Max-Age=31536000; path=/; secure
    set-cookie: wp_automatewoo_session_started=1; path=/; secure
    strict-transport-security: max-age=31536000; includeSubDomains; preload
    vary: User-Agent
    x-content-type-options: nosniff
    x-dns-prefetch-control: on
    x-frame-options: SAMEORIGIN
    x-litespeed-cache-control: no-cache
    x-litespeed-tag: d83_HTTP.302
    x-powered-by: PHP/7.3.27
    x-redirect-by: WordPress
    x-xss-protection: 1; mode=block
    

    -> GET to https://www.________.com/shop/category/product/?unapproved=78377&moderation-hash=a7a3c753ba6dedc641974f63cb847317#comment-78377
    Request headers:

    
    :authority: www.________.com
    :method: GET
    :path: /shop/category/product/?unapproved=78377&moderation-hash=a7a3c753ba6dedc641974f63cb847317
    :scheme: https
    accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    accept-encoding: gzip, deflate, br
    accept-language: it-IT,it;q=0.9
    cache-control: no-cache
    cookie: _lscache_vary=commenter; _ga=GA1.2.1154651686.1654674501; _gid=GA1.2______; wp-wpml_current_language=it; _gat=1; cmplz_saved_categories=["functional"]; cmplz_saved_services={}; cmplz_id=24229; wp_woocommerce_session_16ff2________=t_fbbf14e42d1b9f3428a05b8________________; ls_smartpush=4000003; _gali=submit; wp_automatewoo_visitor_16ff2________=u1dk8dgx38itr10bve63; wp_automatewoo_session_started=1
    pragma: no-cache
    referer: https://www.________.com/shop/category/product/
    sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"
    sec-ch-ua-mobile: ?0
    sec-ch-ua-platform: "macOS"
    sec-fetch-dest: document
    sec-fetch-mode: navigate
    sec-fetch-site: same-origin
    sec-fetch-user: ?1
    upgrade-insecure-requests: 1
    user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36
    

    Response headers, with 200 status code:

    
    cache-control: no-cache
    content-encoding: br
    content-type: text/html; charset=UTF-8
    date: Wed, 08 Jun 2022 07:48:57 GMT
    expires: Wed, 11 Jan 1984 05:00:00 GMT
    link: <https://www.________.com/wp-content/uploads/2016/10/Logo-rosso.png>; rel=preload; as=image
    link: <https://www.________.com/wp-json/>; rel="https://api.w.org/"
    link: <https://www.________.com/wp-json/wp/v2/product/25861>; rel="alternate"; type="application/json"
    link: <https://www.________.com/?p=25861>; rel=shortlink
    server: LiteSpeed
    set-cookie: _lscache_vary=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/shop/category/product/; secure; HttpOnly
    strict-transport-security: max-age=31536000; includeSubDomains; preload
    vary: Accept-Encoding,User-Agent
    x-content-type-options: nosniff
    x-dns-prefetch-control: on
    x-frame-options: SAMEORIGIN
    x-litespeed-cache-control: no-cache
    x-litespeed-tag: d83_HTTP.200
    x-powered-by: PHP/7.3.27
    x-xss-protection: 1; mode=block
    

    Consider that, making the test and having the browser console opened, I saw correctly the notices!

    Thank you for the support!
    Nicola

    Thread Starter Nicola Modugno

    (@shark986)

    Hello qtwrk!

    The response header was initially the standard for the inserted comments:

    Expires: (now + 10min)
    Cache-Control: max-age=600, must-revalidate

    I tried to force them this way (same as “nocache_headers” WP function ):

    Expires => Wed, 11 Jan 1984 05:00:00 GMT
    Cache-Control: no-cache, must-revalidate, max-age=0

    But nothing changed…

    Thread Starter Nicola Modugno

    (@shark986)

    PS: considering that the “add to cart” notice is shown correctly, is it possible that the problem depends by the system used to store it?
    The “add to cart” action is made with a POST to the product page, instead the “save comment” is made with a POST to the wp-comment-post.php, that sends back a “location” header to redirect to the product page.

    Thread Starter Nicola Modugno

    (@shark986)

    I see this details…
    In Analytics: https://tinyurl.com/ybvuyj3n
    (and I don’t understand the value 199000000)

    In the Tag assistant I see 2 events: do you know why?
    https://tinyurl.com/ycgvwmy4
    https://tinyurl.com/y7p5nwwq

    The problem is that I do not see the revenue in GA4 reports. The Google assistance team told me to check the currency….
    “Dopo aver fatto maggiori verifiche all′interno del suo account, ho potuto constatare che c’è da verificare che sia impostata la corretta valuta.”

    I do not what else to check…

    Thread Starter Nicola Modugno

    (@shark986)

    Script reverted and excluded from minification!

    Thread Starter Nicola Modugno

    (@shark986)

    Basically, I have commented out the GA3 pushes and added the currency to the ga4_product var at row 20

    
    	// default, required parameters
    	let ga4_product = {
    		'item_id': productdata.id ? productdata.id : '',
    		'item_name': productdata.name ? productdata.name : '',
    		'item_brand': productdata.brand ? productdata.brand : '',
    		'price': productdata.price ? productdata.price : "",
    		'currency': productdata.currency ? productdata.currency : gtm4wp_currency
    	};
    
    Thread Starter Nicola Modugno

    (@shark986)

    Here you can find the modified script:
    https://www.paoul.com/wp-content/plugins/duracelltomi-google-tag-manager/js/gtm4wp-woocommerce-enhanced.js

    What I can see from the GTM debug tool is that you’ve added lots of extra data layer pushes to null the ecommerce variable. That is mentioned in Google’s docs since a while but the implementation in GTM4WP does not need this if you setup tracking the guide provided on the plugin website.

    You are right. That was a try!

    Thread Starter Nicola Modugno

    (@shark986)

    I found the line of the original script: 756 for the following code

    
    		// fire ga3 version
    		window[ gtm4wp_datalayer_name ].push({
    			'event': 'gtm4wp.productClickEEC',
    			'ecommerce': {
    				'currencyCode': gtm4wp_currency,
    				'click': {
    					'actionField': {'list': dom_productdata.getAttribute( 'data-gtm4wp_productlist_name' )},
    					'products': [ product_data ]
    				}
    			},
    			'eventCallback': function( container_id ) {
    				if (window.gtm4wp_first_container_id != container_id) {
    					// only call this for the first loaded container
    					return true;
    				}
    
    				// fire ga4 version
    				window[ gtm4wp_datalayer_name ].push({
    					'event': 'select_item',
    					'ecommerce': {
    						'currency': gtm4wp_currency,
    						'items': [ gtm4wp_map_eec_to_ga4( product_data ) ]
    					},
    					'eventCallback': function() {
    						if ( ctrl_key_pressed && productpage_window ) {
    							productpage_window.location.href = dom_productdata.getAttribute( 'data-gtm4wp_product_url' );
    						} else {
    							document.location.href = dom_productdata.getAttribute( 'data-gtm4wp_product_url' );
    						}
    
    					},
    					'eventTimeout': 2000
    				});
    			},
    			'eventTimeout': 2000
    		});
    
Viewing 15 replies - 1 through 15 (of 363 total)