Ръководство за настройки на Glami piXel


Събития

Име на събитието Описание на събитието Параметри Задължителни параметри
PageView Стандартно събитие, което може да се постави на всички страници.
ViewContent Когато се разглежда страница, като страница с продукт или категория. content_type, item_ids, value, currency content_type, item_ids
AddToCart Когато продукт е добавен в количката за пазаруване. value, currency, item_ids value, currency, item_ids
Purchase Когато е направена покупка. value, currency, transaction_id, item_ids value, currency, transaction_id, item_ids

Параметри

Име на параметър Описание на параметър Тип на параметър
consent Съгласието на потребителя за съхранение на аналитични бисквитки на устройството. Задайте 1 в случай, че потребителят е дал разрешение. В противен случай задайте 0 за "не". number
content_type Или „product“, или „category“. string
item_ids Идентификатор на продукт, свързан със събитие ViewContent, AddToCart or Purchase. Използвай стойности, които са уникални и не се изменят за целия онлайн магазин. Идентификаторът се състои от всякакви числа / комбинации от стрингове. Използвай ID идентификационни номера, идентични с тези, който си предоставил за ITEM_ID в продуктовия фийд. If you do not have the ITEM_ID for a specific product variant at the time of calling the event (for example, when the customer has not yet selected a specific size for the product), you can send the value of ITEMGROUP_ID to the item_ids parameter. This value must correspond with the value you send in the product feed. array
value Бизнес стойност на потребител, който инициира това събитие number
currency Уточнена валута за value. string
transaction_id ID на транзакция string

ID на съдържание

При всяко отделно събитие можете да използвате който и да е от следните идентификатори: item_ids, category_text, свързани със съдържание от конкретното събитие. Изберете този с най-точно приложение за Вашия магазин. Моля, използвайте ID-та, идентични с тези от Вашия product feed.


ITEM_ID

Това е уникалният продуктов номер - ID номер, който използвате във Вашия онлайн магазин.

GLAMI използва ITEM_ID за разграничаване на продуктите и за осигуряване на правилен тракинг.

  • Стойността може да се състои в комбинация от букви, цифри, наклонени черти (/), обратно наклонени черти (\), тирета (-), подчертаване (_), интервали (), точки (.) и двуеточие(:).
  • Различни размери и цветове на продуктите трябва да имат уникални ITEM_ID.
  • Въведете същата стойност за GLAMI piXel - параметър ITEM_ID. В противен случай GLAMI piXel няма да работи правилно.
  • If you do not have the ITEM_ID for a specific product variant at the time of calling the event (for example, when the customer has not yet selected a specific size for the product), you can send the value of ITEMGROUP_ID to the item_ids parameter. This value must correspond with the value you send in the product feed.


Consent

Consent параметърът позволява на уебсайтовете да коригират поведението на GLAMI Pixel въз основа на състоянието на съгласието на техните потребители по отношение на бисквитките. Ако съществува съгласие (стойност 1) или параметърът не е зададен, GLAMI обработва данните изцяло. Ако няма съгласие (стойност 0), данните ще бъдат обработени анонимно, без да се използват данни за конкретен потребител.

GLAMI PiXel е от решаващо значение за оптималното функциониране на Вашия онлайн магазин на GLAMI. Поради това вече поддържа параметъра Consent, чрез който партньорският онлайн магазин предава информация на GLAMI, за това дали потребителят се е съгласил със създаването на аналитични бисквитки.


Примери за Glami piXel код


За следните примери се нуждаеш от API ключ, който можеш да получиш след регистриране на магазин.
За тази цел можеш да използваш нашата страница за регистриране на магазин.

  • Продуктова страница -> ViewContent (type=product)
  • Страница с категории -> ViewContent (type=category)
  • Събитие при добавяне на продукт в кошницата -> AddToCart
  • Страница за потвърждение на поръчката -> Purchase
  • Всяка друга страница -> PageView

Добавете кода към страниците на уебсайта си преди края на таг </head> в HTML на страницата:


PageView

Постави този код по подразбиране на всички страници. Той може да бъде разширен чрез използване на други събития. Виж по-долу.

<!-- Glami piXel for ONLY_SAMPLE_SHOP_FOR_EXAMPLE -->
<script>
(function(f, a, s, h, i, o, n) {f['GlamiTrackerObject'] = i;
f[i]=f[i]||function(){(f[i].q=f[i].q||[]).push(arguments)};o=a.createElement(s),
n=a.getElementsByTagName(s)[0];o.async=1;o.src=h;n.parentNode.insertBefore(o,n)
})(window, document, 'script', '//glamipixel.com/js/compiled/pt.js', 'glami');

glami(
    'create',
    'INSERT_YOUR_API_KEY_HERE',
    'bg',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);
glami(
    'track',
    'PageView',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);
</script>
<!-- End Glami piXel -->


ViewContent (product)

Добавете този код към всяка страница с подробности за продукта.

glami(
    'track',
    'ViewContent',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        content_type: 'product',
        item_ids: ['ADZXFLUX002'] // currently viewed product ID. Use the same ID as you use in the feed (ITEM_ID)
    }
);

Пример за страница с подробности за продукта.

Този пример показва как трябва да изглежда пълният код на всяка страница с подробности за продукта.

<!-- Glami piXel for ONLY_SAMPLE_SHOP_FOR_EXAMPLE -->
<script>
(function(f, a, s, h, i, o, n) {f['GlamiTrackerObject'] = i;
f[i]=f[i]||function(){(f[i].q=f[i].q||[]).push(arguments)};o=a.createElement(s),
n=a.getElementsByTagName(s)[0];o.async=1;o.src=h;n.parentNode.insertBefore(o,n)
})(window, document, 'script', '//glamipixel.com/js/compiled/pt.js', 'glami');

glami(
    'create',
    'INSERT_YOUR_API_KEY_HERE',
    'bg',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);
glami(
    'track',
    'PageView',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);

glami(
    'track',
    'ViewContent',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        content_type: 'product',
        item_ids: ['ADZXFLUX002'] // currently viewed product ID. Use the same ID as you use in the feed (ITEM_ID)
    }
);
</script>
<!-- End Glami piXel -->


ViewContent (category)

Добавете този код към всяка страница със списък с категории.

glami(
    'track',
    'ViewContent',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        content_type: 'category',
        item_ids: ['ADZXFLUX001', 'NRS02', 'NRS03', 'NRS04', 'NRS05', 'NRS06', 'NRS07', 'NRS08', 'NRS09', 'NRS10'], // currently viewed first 10 product IDs in the category. Use the same IDs as you use in the feed (ITEM_ID).
        category_text: 'Men | Shoes | Sneakers' // currently viewed category_text. Use the same category_text as you use in the feed (CATEGORYTEXT)
    }
);

Пример за страница с категории.

Този пример показва как трябва да изглежда целят код на всяка страница със списък с категории.

<!-- Glami piXel for ONLY_SAMPLE_SHOP_FOR_EXAMPLE -->
<script>
(function(f, a, s, h, i, o, n) {f['GlamiTrackerObject'] = i;
f[i]=f[i]||function(){(f[i].q=f[i].q||[]).push(arguments)};o=a.createElement(s),
n=a.getElementsByTagName(s)[0];o.async=1;o.src=h;n.parentNode.insertBefore(o,n)
})(window, document, 'script', '//glamipixel.com/js/compiled/pt.js', 'glami');

glami(
    'create',
    'INSERT_YOUR_API_KEY_HERE',
    'bg',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);
glami(
    'track',
    'PageView',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);

glami(
    'track',
    'ViewContent',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        content_type: 'category',
        item_ids: ['ADZXFLUX001', 'NRS02', 'NRS03', 'NRS04', 'NRS05', 'NRS06', 'NRS07', 'NRS08', 'NRS09', 'NRS10'], // currently viewed first 10 product IDs in the category. Use the same IDs as you use in the feed (ITEM_ID).
        category_text: 'Men | Shoes | Sneakers' // currently viewed category_text. Use the same category_text as you use in the feed (CATEGORYTEXT)
    }
);
</script>
<!-- End Glami piXel -->


AddToCart

Използвай този код за събитие, при което се добавя продукт към пазарската кошница.

glami(
    'track',
    'AddToCart',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        item_ids: ['ADZXFLUX002'], // product ID currently added to a cart. Use the same ID as you use in the feed (ITEM_ID).
        value: 75.00, // product price
        currency: 'BGN' // product price currency
    }
);


Purchase

Добави този разширен код към всяка страница за благодарност / страница за потвърждение на поръчка.

glami(
    'track',
    'Purchase',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        item_ids: ['ADZXFLUX002', 'NRS01'], // bought product IDs. Use the same IDs as you use in the feed (ITEM_ID).
        value: 112.50, // order value (sum of product values)
        currency: 'BGN', // order value currency
        transaction_id: 'ORDER212' // order ID
    }
);

Пример за страница за благодарност / страница за потвърждение на поръчка.

Този пример показва как трябва да изглежда завършен код в страница за благодарност / страница за потвърждение на поръчка.

<!-- Glami piXel for ONLY_SAMPLE_SHOP_FOR_EXAMPLE -->
<script>
(function(f, a, s, h, i, o, n) {f['GlamiTrackerObject'] = i;
f[i]=f[i]||function(){(f[i].q=f[i].q||[]).push(arguments)};o=a.createElement(s),
n=a.getElementsByTagName(s)[0];o.async=1;o.src=h;n.parentNode.insertBefore(o,n)
})(window, document, 'script', '//glamipixel.com/js/compiled/pt.js', 'glami');

glami(
    'create',
    'INSERT_YOUR_API_KEY_HERE',
    'bg',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);
glami(
    'track',
    'PageView',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);

glami(
    'track',
    'Purchase',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        item_ids: ['ADZXFLUX002', 'NRS01'], // bought product IDs. Use the same IDs as you use in the feed (ITEM_ID).
        value: 112.50, // order value (sum of product values)
        currency: 'BGN', // order value currency
        transaction_id: 'ORDER212' // order ID
    }
);
</script>
<!-- End Glami piXel -->


Имплементация на няколко пиксела на една страница

Следвайте инструкциите, когато искате да поставите няколко пиксел кода на една и съща страница.

Когато искате да поставите няколко pixel кода на една и съща страница, всеки pixel трябва да е дефиниран с уникално име. Ще можете да предоставите уникално име в първото телефонно обаждане. В случай, че има само един pixel код, не е нужно да използвате този идентификатор:

glami(
    'create',
    'API_KEY',
    'cz',
    'PIXEL_IDENTIFIER',
    {
        consent: 1 // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);

Същото уникално име трябва да бъде използвано за "извикването" на този пиксел код.

glami(
    'PIXEL_IDENTIFIER.track',
    'PageView',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);

glami(
    'PIXEL_IDENTIFIER.track',
    'Purchase',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        item_ids: ['ADZXFLUX002'],
        value: 112.50, // order value (sum of product values),
        currency: BGN,
        transaction_id: 'ORDER2'
    }
);

Този пример показва как трябва да изглежда завършен код в страница за благодарност / страница за потвърждение на поръчка.

<!-- Glami piXel for multiple shops -->
<script>
(function(f, a, s, h, i, o, n) {f['GlamiTrackerObject'] = i;
f[i]=f[i]||function(){(f[i].q=f[i].q||[]).push(arguments)};o=a.createElement(s),
n=a.getElementsByTagName(s)[0];o.async=1;o.src=h;n.parentNode.insertBefore(o,n)
})(window, document, 'script', '//glamipixel.com/js/compiled/pt.js', 'glami');

// <!-- BG tracker start
glami(
    'create',
    'BG_API_KEY',
    'bg',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);
glami(
    'track',
    'PageView',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);

glami(
    'track',
    'Purchase', {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        item_ids: ['ADZXFLUX002', 'NRS01'],
        value: 112.50,
        currency: 'BGN',
        transaction_id: 'ORDER1'
    }
);
// BG tracker end -->

// <!-- SK tracker start
glami(
    'create',
    'SK_API_KEY',
    'sk',
    'sktracker',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);
glami(
    'sktracker.track',
    'PageView',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);

glami(
    'sktracker.track',
    'Purchase',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        item_ids: ['ADZXFLUX002'],
        value: 50.00,
        currency: 'EUR',
        transaction_id: 'ORDER2'
    }
);
// SK tracker end -->

// <!-- some other tracker tracker start
glami(
    'create',
    'SOME_OTHER_API_KEY',
    bg,
    'sometrackername',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);
glami(
    'sometrackername.track',
    'PageView',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
    }
);

glami(
    'sometrackername.track',
    'Purchase',
    {
        consent: 1, // The user's consent to the storage analytical cookies on their devices. [0 = no; 1 = yes]
        item_ids: ['ADZXFLUX002'],
        value: 112.50, // order value (sum of product values),
        currency: BGN,
        transaction_id: 'ORDER2'
    }
);
// some other tracker end -->
</script>
<!-- End Glami piXel -->

Можете да използвате този метод, за да промените стойността на параметъра за съгласие на GLAMI Pixel по всяко време. В случай че използвате програма за управление на съгласието за използване на бисквитки (напр. cookiebot или друга), е необходимо да изпратите това съгласие на GLAMI Pixel, след като то е било предоставено. GLAMI Pixel често се зарежда преди действителното съгласие чрез модул за управление на съгласието за бисквитки. В този случай е необходимо да се изпозлва следният метод и да се подаде нова стойност на параметъра за съгласие.


glami('set', {consent: 1});
            

Политика за защита на съдържание (CSP) настройки на заглавието

Ако уебсайтът Ви използва Content Security Policy, трябва да активирате Javascript кода GLAMI Pixel на страницата си. Добавете следните CSP правила в заглавната част на HTTP отговора на Вашия уеб сървър:

Content-Security-Policy: default-src 'self'; script-src 'unsafe-inline' www.glami.bg glamipixel.com; img-src www.glami.bg glamipixel.com