Short JavaScript code snippets for custom javascript variables in Google Tag Manager
Inspired by the 30 seconds code project, we decided to create together to the Google Tag Manager community a series of code snippets to help create custom javascript variables in Google Tag Manager.
See the snippets folder to get all scripts or read 1:1 script;
- Convert Google Analytics 4
items
array
in Facebookcontents
pattern; - Convert Google Analytics 4
view_item
event parameter in FacebookviewContent
parameters; - Convert Google Analytics 4
add_to_cart
event parameters in FacebooAddToCart
parameters - Convert Google Analytics 4
purchase
event parameters in FacebookPurchase
parameters - Get Google Analytics
client_id
andsession_id
;
Use the snippet template as a reference and create in snippets folder.