12 октября 2023
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e1',
'event_cat': 'registration',
'event_name': 'success',
'event_param': {'registration_type': '{{тип регистрации}}'}
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e1',
'event_cat': 'registration',
'event_name': 'success',
'event_param': {'registration_type': '{{тип регистрации}}'}
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e2',
'event_cat': 'purchase',
'event_name': 'main_page_view',
'event_param': ''
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e3',
'event_cat': 'purchase',
'event_name': 'item_view',
'event_param': {
'item_id': '{{id товара}}',
'item_price': '{{цена товара}}'
}
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e4',
'event_cat': 'purchase',
'event_name': 'add_to_cart',
'event_param': {
'item_id': '{{id товара}}',
'item_price': '{{цена товара}}'
}
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e5',
'event_cat': 'purchase',
'event_name': 'success',
'event_param': {
'purchase_sum': '{{сумма покупки}}',
'item_amount': '{{количество товаров в покупке}}'
}
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeActions',
'event_id': 'd-v1-e6',
'event_cat': 'favorite',
'event_name': 'add',
'event_param': {
'item_id': '{{id товара}}',
'item_price': '{{цена товара}}'
}
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeActions',
'event_id': 'd-v1-e6',
'event_cat': 'favorite',
'event_name': 'add',
'event_param': {
'item_id': null,
'item_price': '{{цена товара}}'
}
});
</script>
<script>
(function(){
var amplitudeCounter = 0;
function mainTagFunction() {
try {
amplitude.getInstance().logEvent('{{LT_Amplitude_event}}', {{varDL_event_param}});
dataLayer.push({'event_param': ''});
} catch (e) {}
}
function amplitudeSdkSearch() {
if (window.amplitude) mainTagFunction();
else {
if (amplitudeCounter < 50) {
setTimeout(amplitudeSdkSearch, 100);
amplitudeCounter++;
}
}
}
amplitudeSdkSearch();
})();
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e0',
'event_cat': 'example',
'event_name': 'success',
'property1': 'value1',
'property2': 'value2'
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e1',
'event_cat': 'registration',
'event_name': 'success',
'registration_type': '{{тип регистрации}}'
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e2',
'event_cat': 'purchase',
'event_name': 'main_page_view'
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e3',
'event_cat': 'purchase',
'event_name': 'item_view',
'item_id': '{{id товара}}',
'item_price': '{{цена товара}}'
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e4',
'event_cat': 'purchase',
'event_name': 'add_to_cart',
'item_id': '{{id товара}}',
'item_price': '{{цена товара}}'
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e5',
'event_cat': 'purchase',
'event_name': 'success',
'purchase_sum': '{{сумма покупки}}',
'item_amount': '{{количество товаров в покупке}}'
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeActions',
'event_id': 'd-v1-e6',
'event_cat': 'favorite',
'event_name': 'add',
'item_id': '{{id товара}}',
'item_price': '{{цена товара}}'
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeActions',
'event_id': 'd-v1-e6',
'event_cat': 'favorite',
'event_name': 'add',
'item_id': null,
'item_price': '{{цена товара}}'
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeActions',
'event_id': 'd-v1-e6',
'event_cat': 'favorite',
'event_name': 'add',
'item_price': '{{цена товара}}'
});
</script>
<script>
(function(){
var amplitudeCounter = 0;
function mainTagFunction() {
try {
var obj = JSON.parse('{{LT_Amplitude_params}}');
amplitude.track('{{LT_Amplitude_event}}', obj);
} catch (e) {}
}
function amplitudeSdkSearch() {
if (window.amplitude) mainTagFunction();
else {
if (amplitudeCounter < 50) {
setTimeout(amplitudeSdkSearch, 100);
amplitudeCounter++;
}
}
}
amplitudeSdkSearch();
})();
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e1',
'event_cat': 'registration',
'event_name': 'success',
'registration_type': JSON.stringify('{{тип регистрации}}')
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e2',
'event_cat': 'purchase',
'event_name': 'main_page_view'
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e3',
'event_cat': 'purchase',
'event_name': 'item_view',
'item_id': JSON.stringify('{{id товара}}'),
'item_price': JSON.stringify('{{цена товара}}')
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e4',
'event_cat': 'purchase',
'event_name': 'add_to_cart',
'item_id': JSON.stringify('{{id товара}}'),
'item_price': JSON.stringify('{{цена товара}}')
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e5',
'event_cat': 'purchase',
'event_name': 'success',
'purchase_sum': JSON.stringify('{{сумма покупки}}'),
'item_amount': JSON.stringify('{{количество товаров в покупке}}')
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeActions',
'event_id': 'd-v1-e6',
'event_cat': 'favorite',
'event_name': 'add',
'item_id': JSON.stringify('{{id товара}}'),
'item_price': JSON.stringify('{{цена товара}}')
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeActions',
'event_id': 'd-v1-e6',
'event_cat': 'favorite',
'event_name': 'add',
'item_id': null,
'item_price': JSON.stringify('{{цена товара}}')
});
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeActions',
'event_id': 'd-v1-e6',
'event_cat': 'favorite',
'event_name': 'add',
'item_price': JSON.stringify('{{цена товара}}')
});
</script>
<script>
(function(){
var amplitudeCounter = 0;
function mainTagFunction() {
try {
var event_name = '{{LT_Amplitude_event}}';
if (event_name == 'conversionStep_[registration]_success') {
amplitude.track(event_name, {'registration_type': JSON.parse("{{varDL_registration_type}}")});
} else if (event_name == 'conversionStep_[purchase]_main_page_view') {
amplitude.track(event_name);
} else if (event_name == 'conversionStep_[purchase]_item_view') {
amplitude.track(event_name, {"item_id": JSON.parse("{{varDL_item_id}}"), "item_price": JSON.parse("{{varDL_item_price}}")});
} else if (event_name == 'conversionStep_[purchase]_add_to_cart') {
amplitude.track(event_name, {"item_id": JSON.parse("{{varDL_item_id}}"), "item_price": JSON.parse("{{varDL_item_price}}")});
} else if (event_name == 'conversionStep_[purchase]_success') {
amplitude.track(event_name, {"purchase_sum": JSON.parse("{{varDL_purchase_sum}}"), "item_amount": JSON.parse("{{varDL_item_amount}}")});
} else if (event_name == 'makeActions_[favorite]_add') {
amplitude.track(event_name, {"item_id": JSON.parse("{{varDL_item_id}}"), "item_price": JSON.parse("{{varDL_item_price}}")});
}
} catch (e) {}
}
function amplitudeSdkSearch() {
if (window.amplitude) mainTagFunction();
else {
if (amplitudeCounter < 50) {
setTimeout(amplitudeSdkSearch, 100);
amplitudeCounter++;
}
}
}
amplitudeSdkSearch();
})();
</script>
<script>
dataLayer.push({
'event': 'addEvents_makeConversions',
'event_id': 'd-v1-e0',
'event_cat': 'purchase',
'event_name': 'example',
'property1': JSON.stringify(['value1', 'value2', 'value3']),
'property2': JSON.stringify('value4')
});
</script>
<script>
dataLayer.push({
'event': 'addUserProperties',
'user_property_id': 'd-v1-up1',
'user_property_name': 'user_property1',
'user_property1': JSON.stringify('value1')
});
</script>
<script>
dataLayer.push({
'event': 'addUserProperties',
'user_property_id': 'd-v1-up1',
'user_property_name': 'user_property2',
'user_property2': JSON.stringify(['value2', 'value3', 'value4'])
});
</script>
<script>
dataLayer.push({
'event': 'addUserProperties',
'user_property_id': 'd-v1-up1',
'user_property_name': 'age',
'age': JSON.stringify('{{возраст}}')
});
</script>
<script>
dataLayer.push({
'event': 'addUserProperties',
'user_property_id': 'd-v1-up2',
'user_property_name': 'gender',
'gender': JSON.stringify('{{пол}}')
});
</script>
<script>
dataLayer.push({
'event': 'addUserProperties',
'user_property_id': 'd-v1-up3',
'user_property_name': 'favorites_amount',
'favorites_amount': JSON.stringify('{{количество товаров в избранном}}')
});
</script>
<script>
dataLayer.push({
'event': 'addUserProperties',
'user_property_id': 'd-v1-up4',
'user_property_name': 'registration_date',
'registration_date': JSON.stringify('{{дата регистрации в iso формате}}')
});
</script>
<script>
(function(){
var amplitudeCounter = 0;
function mainTagFunction() {
var properties_value = JSON.parse('{{LT_user_properties_value}}');
var identify = new amplitude.Identify().set('{{varDL_user_property_name}}', properties_value);
amplitude.getInstance().identify(identify);
}
function amplitudeSdkSearch() {
if (window.amplitude) mainTagFunction();
else {
if (amplitudeCounter < 50) {
setTimeout(amplitudeSdkSearch, 100);
amplitudeCounter++;
}
}
}
amplitudeSdkSearch();
})();
</script>
<script>
dataLayer.push({
'event': 'setUserId',
'user_id': 'user_id_value'
});
</script>
<!-- Код контейнера GTM -->
<script>
(function(){
var amplitudeCounter = 0;
function mainTagFunction() {
amplitude.setUserId('{{varDL_user_id}}');
}
function amplitudeSdkSearch() {
if (window.amplitude) mainTagFunction();
else {
if (amplitudeCounter < 50) {
setTimeout(amplitudeSdkSearch, 100);
amplitudeCounter++;
}
}
}
amplitudeSdkSearch();
})();
</script>