Google Tag Manager to proste narzędzie do zarządzania tagami i kodami JavaScript wstawianymi na stronę internetową. Dzięki niemu możesz łatwo dodawać i usuwać kody zewnętrznych partnerów bez konieczności ingerencji w kod strony. Zobacz, jak skorzystać z tej metody integracji.
The following instructions apply to shops that use e-commerce in GA4.
Krok 1 Skrypt ładujący
Add the Load script as custom HTML and set it to run on every page of your shop.
Download it tutaj..
Note: your-shop-ID: 49, → 49 should be replaced by the shop id provided by the 100SHOPPERS manager.

Krok 2 Container ID
Activate Container ID as the default variable:

Krok 3 Skrypt rejestrujący
Dodaj skrypt rejestrujący zamówienie jako tag niestandardowy. Jako regułę uruchamiającą należy ustawić wydarzenie niestandardowe purchase.
Configure the rule

Tag configuration – Custom HTML code

Skrypt do użycia
Zwróć uwagę na dane jakie skrypt musi zwracać, np. productId, quantity czy gross.
<script type="text/javascript">
if (typeof bb != "undefined") {
var dlv = function(key){ return google_tag_manager[{{Container ID}}].dataLayer.get(key) };
if (dlv("ecommerce.items").length) {
var bbData = [];
for (var i=0; i < dlv("ecommerce.items").length; i++) {
bbData.push({
productId: dlv("ecommerce.items")[i].item_id,
quantity: dlv("ecommerce.items")[i].quantity,
commissionId: 844,
gross: dlv("ecommerce.items")[i].price,
});
}
bb('order', { orderId: dlv("ecommerce.transaction_id"), products: bbData });
}
}
</script>
Note: commissionId: 844, → 844 should be replaced by the commission id provided by the 100SHOPPERS Manager.
Test poprawności integracji
Po umieszczeniu skryptów i poprawnej konfiguracji w Google Tag Manager, prześlij informację Opiekunowi, który dokona testowej transakcji w celu sprawdzenia poprawności integracji.