first commit

This commit is contained in:
2024-11-05 12:22:50 +01:00
commit e5682a3912
19641 changed files with 2948548 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
{*
* 2012-2022 Patryk Marek PrestaDev.pl
*
* Patryk Marek PrestaDev.pl - PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module © All rights reserved.
*
* DISCLAIMER
*
* Do not edit, modify or copy this file.
* If you wish to customize it, contact us at info@prestadev.pl.
*
* @author Patryk Marek <info@prestadev.pl>
* @copyright 2012-2022 Patryk Marek @ PrestaDev.pl
* @license Do not edit, modify or copy this file, if you wish to customize it, contact us at info@prestadev.pl.
* @link http://prestadev.pl
* @package PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module
* @version 1.0.2
* @date 01-05-2021
*}
<!-- PD Google Analytycs 4 Pro - EVENT > add_shipping_info -->
<script type="text/javascript">
console.log('Fired up event GA4: add_shipping_info');
gtag('event', 'add_shipping_info', {
coupon: '{$content_coupon|escape:'htmlall':'UTF-8'}',
currency: '{$currency|escape:'htmlall':'UTF-8'}',
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer_name|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant|escape:'htmlall':'UTF-8'}{/if}',
price: {$product.price_old|floatval},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: '{$product.cart_quantity|escape:'htmlall':'UTF-8'}'
},
{/foreach}
],
shipping_tier: '{$carrier_name|escape:'htmlall':'UTF-8'}',
value: {$content_value|escape:'htmlall':'UTF-8'}
});
</script>
<!-- PD Google Analytycs 4 Pro - EVENT > add_shipping_info -->

View File

@@ -0,0 +1,52 @@
{*
* 2012-2022 Patryk Marek PrestaDev.pl
*
* Patryk Marek PrestaDev.pl - PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module © All rights reserved.
*
* DISCLAIMER
*
* Do not edit, modify or copy this file.
* If you wish to customize it, contact us at info@prestadev.pl.
*
* @author Patryk Marek <info@prestadev.pl>
* @copyright 2012-2022 Patryk Marek @ PrestaDev.pl
* @license Do not edit, modify or copy this file, if you wish to customize it, contact us at info@prestadev.pl.
* @link http://prestadev.pl
* @package PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module
* @version 1.0.2
* @date 01-05-2021
*}
<!-- PD Google Analytycs 4 Pro - EVENT > add_payment_info -->
<script type="text/javascript">
console.log('Fired up event GA4: add_payment_info');
gtag('event', 'add_payment_info', {
coupon: '{$content_coupon|escape:'htmlall':'UTF-8'}',
currency: '{$currency|escape:'htmlall':'UTF-8'}',
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer_name|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant|escape:'htmlall':'UTF-8'}{/if}',
price: {$product.price_old|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: '{$product.cart_quantity|escape:'htmlall':'UTF-8'}'
},
{/foreach}
],
payment_type: '{$payment_name|escape:'htmlall':'UTF-8'}',
value: {$content_value|escape:'htmlall':'UTF-8'}
});
</script>
<!-- PD Google Analytycs 4 Pro - EVENT > add_payment_info -->

View File

@@ -0,0 +1,34 @@
{*
* 2012-2022 Patryk Marek PrestaDev.pl
*
* Patryk Marek PrestaDev.pl - PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module © All rights reserved.
*
* DISCLAIMER
*
* Do not edit, modify or copy this file.
* If you wish to customize it, contact us at info@prestadev.pl.
*
* @author Patryk Marek <info@prestadev.pl>
* @copyright 2012-2022 Patryk Marek @ PrestaDev.pl
* @license Do not edit, modify or copy this file, if you wish to customize it, contact us at info@prestadev.pl.
* @link http://prestadev.pl
* @package PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module
* @version 1.0.2
* @date 01-05-2021
*}
<!-- PD Google Analytycs 4 Pro - EVENT > refund -->
<script type="text/javascript">
console.log('Fired up event GA4: refund');
gtag('event', 'refund', {
currency: '{$currency|escape:'htmlall':'UTF-8'}',
transaction_id: '{$transaction_id|escape:'htmlall':'UTF-8'}',
value: {$value|escape:'htmlall':'UTF-8'},
affiliation: '{$affiliation|escape:'htmlall':'UTF-8'}',
coupon: '{$coupon|escape:'htmlall':'UTF-8'}',
shipping: {$shipping|escape:'htmlall':'UTF-8'},
tax: {$tax|escape:'htmlall':'UTF-8'}
});
</script>
<!-- PD Google Analytycs 4 Pro - EVENT > refund -->

View File

@@ -0,0 +1,40 @@
{*
* 2012-2022 Patryk Marek PrestaDev.pl
*
* Patryk Marek PrestaDev.pl - PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module © All rights reserved.
*
* DISCLAIMER
*
* Do not edit, modify or copy this file.
* If you wish to customize it, contact us at info@prestadev.pl.
*
* @author Patryk Marek <info@prestadev.pl>
* @copyright 2012-2022 Patryk Marek @ PrestaDev.pl
* @license Do not edit, modify or copy this file, if you wish to customize it, contact us at info@prestadev.pl.
* @link http://prestadev.pl
* @package PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module
* @version 1.0.1
* @date 01-05-2021
*}
{if isset($pd_google_analytics_id)}
<!-- START > PD Google Analytycs 4.0 1.6.x and 1.7.x Module -->
<script async data-keepinline="true" src="https://www.googletagmanager.com/gtag/js?id={$pd_google_analytics_id|escape:'htmlall':'UTF-8'}"></script>
{literal}
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{/literal}{$pd_google_analytics_id|escape:'htmlall':'UTF-8'}{literal}', {'send_page_view': {/literal}{$pd_google_analytics_spv|escape:'htmlall':'UTF-8'}{literal}});
{/literal}{if isset($pd_google_analytics_id2) && !empty($pd_google_analytics_id2)}{literal}gtag('config', '{/literal}{$pd_google_analytics_id2|escape:'htmlall':'UTF-8'}{literal}', {'send_page_view': {/literal}{$pd_google_analytics_spv|escape:'htmlall':'UTF-8'}{literal}});
{/literal}{/if}{literal}gtag('set', {currency: '{/literal}{$pd_google_analytics_currency|escape:'htmlall':'UTF-8'}{literal}'});
gtag('set', {country: '{/literal}{$pd_google_analytics_country|escape:'htmlall':'UTF-8'}{literal}'});
{/literal}{if isset($pd_google_analytics_id_aw) && !empty($pd_google_analytics_id_aw)}{literal}gtag('config', '{/literal}{$pd_google_analytics_id_aw|escape:'htmlall':'UTF-8'}{literal}');
{/literal}{/if}{literal}
</script>
{/literal}
<!-- END > PD Google Analytycs 4.0 1.6.x and 1.7.x Module -->
{/if}

View File

@@ -0,0 +1,28 @@
{*
* 2012-2022 Patryk Marek PrestaDev.pl
*
* Patryk Marek PrestaDev.pl - PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module © All rights reserved.
*
* DISCLAIMER
*
* Do not edit, modify or copy this file.
* If you wish to customize it, contact us at info@prestadev.pl.
*
* @author Patryk Marek <info@prestadev.pl>
* @copyright 2012-2022 Patryk Marek @ PrestaDev.pl
* @license Do not edit, modify or copy this file, if you wish to customize it, contact us at info@prestadev.pl.
* @link http://prestadev.pl
* @package PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module
* @version 1.0.2
* @date 01-05-2021
*}
<script type="text/javascript">
{literal}
gtag('event', 'login', {
method: 'PrestaShop'
});
{/literal}
</script>

View File

@@ -0,0 +1,372 @@
{*
* 2012-2022 Patryk Marek PrestaDev.pl
*
* Patryk Marek PrestaDev.pl - PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module © All rights reserved.
*
* DISCLAIMER
*
* Do not edit, modify or copy this file.
* If you wish to customize it, contact us at info@prestadev.pl.
*
* @author Patryk Marek <info@prestadev.pl>
* @copyright 2012-2022 Patryk Marek @ PrestaDev.pl
* @license Do not edit, modify or copy this file, if you wish to customize it, contact us at info@prestadev.pl.
* @link http://prestadev.pl
* @package PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module
* @version 1.0.2
* @date 01-05-2021
*}
{if $tagType != 'none'}
<!-- PD Google Analytycs 4 Pro - EVENTS CODE FOOTER -->
<script type="text/javascript" >
{if ($tagType === 'product')}
console.log('Fired up event GA4: view_item > Product page');
gtag('event', 'view_item', {
items: [{
item_id: '{$content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$content_name|escape:'htmlall':'UTF-8'}',
coupon: '{$content_coupon|escape:'htmlall':'UTF-8'}',
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
discount: {$content_discount|escape:'htmlall':'UTF-8'},
item_brand: '{$content_manufacturer|escape:'htmlall':'UTF-8'}',
item_category: '{$content_category|escape:'htmlall':'UTF-8'}',
item_list_name: '{$item_list_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$item_list_id|escape:'htmlall':'UTF-8'}',
{if !empty($content_category2)}item_category2: '{$content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($content_category3)}item_category3: '{$content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($content_category4)}item_category4: '{$content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($content_category5)}item_category5: '{$content_category3|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{$content_variant|escape:'htmlall':'UTF-8'}',
item_list_name: "Product page",
item_list_id: '{$item_list_name|escape:'htmlall':'UTF-8'}',
list_position: 1,
price: {$content_value_old|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: 1,
}],
value: {$content_value|escape:'htmlall':'UTF-8'}
});
{else if ($tagType === 'cart')}
console.log('Fired up event GA4: view_cart');
gtag('event', 'view_cart', {
currency: '{$currency|escape:'htmlall':'UTF-8'}',
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
index: {$smarty.foreach.products.index},
item_list_name: 'Cart products',
item_list_id: 1,
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer_name|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
price: {$product.price|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: '{$product.cart_quantity|escape:'htmlall':'UTF-8'}'
},
{/foreach}
],
value: {$content_value|escape:'htmlall':'UTF-8'}
});
console.log('Fired up event GA4: begin_checkout');
gtag('event', 'begin_checkout', {
coupon: '{$content_coupon|escape:'htmlall':'UTF-8'}',
currency: '{$currency|escape:'htmlall':'UTF-8'}',
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
index: {$smarty.foreach.products.index},
item_list_name: 'Cart products',
item_list_id: 1,
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer_name|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
price: {$product.price|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: '{$product.cart_quantity|escape:'htmlall':'UTF-8'}'
},
{/foreach}
],
value: {$content_value|escape:'htmlall':'UTF-8'}
});
{else if ($tagType === 'order' || $tagType === 'order-opc')}
console.log('Fired up event GA4: begin_checkout');
gtag('event', 'begin_checkout', {
coupon: '{$content_coupon|escape:'htmlall':'UTF-8'}',
currency: '{$currency|escape:'htmlall':'UTF-8'}',
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
index: {$smarty.foreach.products.index},
item_list_name: 'Cart products',
item_list_id: 1,
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer_name|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
price: {$product.price|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: '{$product.cart_quantity|escape:'htmlall':'UTF-8'}'
},
{/foreach}
],
value: {$content_value|escape:'htmlall':'UTF-8'}
});
console.log('Fired up event GA4: view_cart');
gtag('event', 'view_cart', {
currency: '{$currency|escape:'htmlall':'UTF-8'}',
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
index: {$smarty.foreach.products.index},
item_list_name: 'Cart products',
item_list_id: 1,
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer_name|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
price: {$product.price|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: '{$product.cart_quantity|escape:'htmlall':'UTF-8'}'
},
{/foreach}
],
value: {$content_value|escape:'htmlall':'UTF-8'}
});
{else if ($tagType === 'category')}
console.log('Fired up event GA4: view_item_list > Category products list page');
gtag('event', 'view_item_list', {
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.product_name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
index: {$smarty.foreach.products.index},
item_list_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$page|escape:'htmlall':'UTF-8'}',
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer|escape:'htmlall':'UTF-8'}',
item_category: '{$content_category|escape:'htmlall':'UTF-8'}',
{if !empty($content_category2)}item_category2: '{$content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($content_category3)}item_category3: '{$content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($content_category4)}item_category4: '{$content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($content_category5)}item_category5: '{$content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
price: {$product.price_amount|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: 1
},
{/foreach}
],
item_list_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$page|escape:'htmlall':'UTF-8'}'
});
{else if ($tagType === 'prices-drop')}
console.log('Fired up event GA4: view_promotion > Products list prices drop page');
gtag('event', 'view_promotion', {
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.product_name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
index: {$smarty.foreach.products.index},
item_list_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$page|escape:'htmlall':'UTF-8'}',
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
price: {$product.price_amount|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: 1
},
{/foreach}
],
item_list_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$page|escape:'htmlall':'UTF-8'}'
});
console.log('Fired up event GA4: view_item_list > Products list prices drop page');
gtag('event', 'view_item_list', {
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.product_name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
index: {$smarty.foreach.products.index},
item_list_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$page|escape:'htmlall':'UTF-8'}',
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
price: {$product.price_amount|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: 1
},
{/foreach}
],
item_list_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$page|escape:'htmlall':'UTF-8'}'
});
{else if ($tagType === 'best-sales')}
console.log('Fired up event GA4: view_item_list > Products best-sales list page');
gtag('event', 'view_item_list', {
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.product_name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
index: {$smarty.foreach.products.index},
item_list_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$page|escape:'htmlall':'UTF-8'}',
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
price: {$product.price_amount|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: 1
},
{/foreach}
],
item_list_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$page|escape:'htmlall':'UTF-8'}'
});
{else if ($tagType === 'new-products')}
console.log('Fired up event GA4: view_item_list > New products list page');
gtag('event', 'view_item_list', {
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.product_name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
index: {$smarty.foreach.products.index},
item_list_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$page|escape:'htmlall':'UTF-8'}',
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
price: {$product.price_amount|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: 1
},
{/foreach}
],
item_list_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_list_id: '{$page|escape:'htmlall':'UTF-8'}'
});
{else if ($tagType === 'search')}
console.log('Fired up event GA4: search');
gtag('event', 'search', {
search_term: '{$search_string|escape:'htmlall':'UTF-8'}',
});
{else if ($tagType === 'cms')}
console.log('Fired up event: view_item');
gtag('event', 'view_item', {
item_name: 'Cms page: {$content_name|escape:'htmlall':'UTF-8'}',
item_id: {$content_ids|escape:'htmlall':'UTF-8'}
});
{else if ($tagType === 'other')}
console.log('Fired up event: view_item');
gtag('event', 'view_item', {
item_name: '{$content_name|escape:'htmlall':'UTF-8'}',
item_id: '{$content_ids|escape:'htmlall':'UTF-8'}'
});
{/if}
{if isset($account_created) && $account_created}
console.log('Fired up event GA4: sign_up');
gtag('event', 'sign_up', {
method: '{$registration_content_name|escape:'htmlall':'UTF-8'}'
});
{/if}
</script>
<!-- PD Google Analytycs 4 Pro - EVENTS CODE FOOTER -->
{/if}

View File

@@ -0,0 +1,57 @@
{*
* 2012-2022 Patryk Marek PrestaDev.pl
*
* Patryk Marek PrestaDev.pl - PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module © All rights reserved.
*
* DISCLAIMER
*
* Do not edit, modify or copy this file.
* If you wish to customize it, contact us at info@prestadev.pl.
*
* @author Patryk Marek <info@prestadev.pl>
* @copyright 2012-2022 Patryk Marek @ PrestaDev.pl
* @license Do not edit, modify or copy this file, if you wish to customize it, contact us at info@prestadev.pl.
* @link http://prestadev.pl
* @package PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module
* @version 1.0.1
* @date 01-05-2021
*}
{if isset($pd_google_analytics_id)}
<!-- START > PD Google Analytycs 4.0 Module -->
<script async data-keepinline="true" src="https://www.googletagmanager.com/gtag/js?id={$pd_google_analytics_id nofilter}"></script>
{literal}
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{/literal}{$pd_google_analytics_id nofilter}{literal}', {
'send_page_view': {/literal}{$pd_google_analytics_spv nofilter}{if isset($pd_google_analytics_aec) && $pd_google_analytics_aec},
{literal}'allow_enhanced_conversions': {/literal}{$pd_google_analytics_aec nofilter}{/if}{literal}});
{/literal}{if isset($pd_google_analytics_id2) && !empty($pd_google_analytics_id2)}{literal}gtag('config', '{/literal}{$pd_google_analytics_id2 nofilter}{literal}', {
'send_page_view': {/literal}{$pd_google_analytics_spv nofilter}{if isset($pd_google_analytics_aec) && $pd_google_analytics_aec},
{literal}'allow_enhanced_conversions': {/literal}{$pd_google_analytics_aec nofilter}{/if}{literal}});
{/literal}{/if}{literal}gtag('set', {'currency': {/literal}"{$pd_google_analytics_currency_iso nofilter}"{literal}});
gtag('set', {'country': {/literal}"{$pd_google_analytics_country_iso nofilter}"{literal}});
{/literal}{if !empty($pd_google_analytics_id_aw) && !empty($pd_google_analytics_id_aw_label)}{literal}gtag('config', '{/literal}{$pd_google_analytics_id_aw nofilter}{literal}');
{/literal}{/if}
{if isset($pd_google_analytics_aec) && $pd_google_analytics_aec != 'false' && !empty($pd_google_analytics_city)}
gtag('set', 'user_data', {
{if !empty($pd_google_analytics_email)}{literal}"email": "{/literal}{$pd_google_analytics_email nofilter}",{/if}
{if !empty($pd_google_analytics_phone)}{literal}"phone_number": "{/literal}{$pd_google_analytics_phone nofilter}"{/if},
{literal}"address": {{/literal}
{if !empty($pd_google_analytics_firstname)}{literal}"first_name": "{/literal}{$pd_google_analytics_firstname nofilter}",{/if}
{if !empty($pd_google_analytics_lastname)}{literal}"last_name": "{/literal}{$pd_google_analytics_lastname nofilter}",{/if}
{if !empty($pd_google_analytics_street)}{literal}"street": "{/literal}{$pd_google_analytics_street nofilter}",{/if}
{if !empty($pd_google_analytics_city)}{literal}"city": "{/literal}{$pd_google_analytics_city nofilter}",{/if}
{if !empty($pd_google_analytics_postcode)}{literal}"postal_code": "{/literal}{$pd_google_analytics_postcode nofilter}",{/if}
{if !empty($pd_google_analytics_country)}{literal}"country": "{/literal}{$pd_google_analytics_country nofilter}"{/if}
}
});
{/if}
</script>
<!-- END > PD Google Analytycs 4.0 Module -->
{/if}

View File

@@ -0,0 +1,67 @@
{*
* 2012-2022 Patryk Marek PrestaDev.pl
*
* Patryk Marek PrestaDev.pl - PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module © All rights reserved.
*
* DISCLAIMER
*
* Do not edit, modify or copy this file.
* If you wish to customize it, contact us at info@prestadev.pl.
*
* @author Patryk Marek <info@prestadev.pl>
* @copyright 2012-2022 Patryk Marek @ PrestaDev.pl
* @license Do not edit, modify or copy this file, if you wish to customize it, contact us at info@prestadev.pl.
* @link http://prestadev.pl
* @package PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module
* @version 1.0.2
* @date 01-05-2021
*}
<!-- PD Google Analytycs 4 Pro - EVENT > purchase -->
<script type="text/javascript" data-keepinline="true">
console.log('Fired up event GA4: purchase');
gtag('event', 'purchase', {
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
coupon: '{$content_coupon|escape:'htmlall':'UTF-8'}',
currency: '{$currency|escape:'htmlall':'UTF-8'}',
items: [
{foreach from=$content_products item=product name=products}
{
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
item_name: '{$product.product_name|escape:'htmlall':'UTF-8'}',
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
discount: {$product.discount|escape:'htmlall':'UTF-8'},
index: {$smarty.foreach.products.index},
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
item_brand: '{$product.manufacturer|escape:'htmlall':'UTF-8'}',
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
price: {$product.price|escape:'htmlall':'UTF-8'},
currency: '{$currency|escape:'htmlall':'UTF-8'}',
quantity: '{$product.product_quantity|escape:'htmlall':'UTF-8'}'
},
{/foreach}
],
transaction_id: '{$content_transaction_id|escape:'htmlall':'UTF-8'}',
shipping: {$content_shipping|escape:'htmlall':'UTF-8'},
value: {$content_value|escape:'htmlall':'UTF-8'},
tax: {$content_tax|escape:'htmlall':'UTF-8'}
});
{if !empty($pd_google_analytics_id_aw) && !empty($pd_google_analytics_id_aw_label)}
console.log('Fired up event Gtag: Ads / Adwords conversion');
gtag('event', 'conversion', {
'send_to': '{$pd_google_analytics_id_aw|escape:'htmlall':'UTF-8'}/{$pd_google_analytics_id_aw_label|escape:'htmlall':'UTF-8'}',
'value': '{$content_value|escape:'htmlall':'UTF-8'}',
'currency': '{$currency|escape:'htmlall':'UTF-8'}',
'transaction_id': '{$content_transaction_id|escape:'htmlall':'UTF-8'}'
});
{/if}
</script>
<!-- PD Google Analytycs 4 Pro - EVENT > purchase -->

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2012-2022 Patryk Marek PrestaDev.pl
*
* Patryk Marek PrestaDev.pl - PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module © All rights reserved.
*
* DISCLAIMER
*
* Do not edit, modify or copy this file.
* If you wish to customize it, contact us at info@prestadev.pl.
*
* @author Patryk Marek <info@prestadev.pl>
* @copyright 2012-2022 Patryk Marek @ PrestaDev.pl
* @license Do not edit, modify or copy this file, if you wish to customize it, contact us at info@prestadev.pl.
* @link http://prestadev.pl
* @package PD Google Analytycs 4.0 Pro 1.6.x and 1.7.x Module
* @version 1.0.1
* @date 01-05-2021
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;