|
| 1 | +{% set genderMap = constant('BitBag\\SyliusUserComPlugin\\Builder\\Payload\\CustomerPayloadBuilderInterface::GENDER_MAP')%} |
| 2 | +{% set active = constant('BitBag\\SyliusUserComPlugin\\Builder\\Payload\\CustomerPayloadBuilderInterface::STATUS_USER')%} |
| 3 | +{% set visitor = constant('BitBag\\SyliusUserComPlugin\\Builder\\Payload\\CustomerPayloadBuilderInterface::STATUS_VISITOR')%} |
| 4 | +{% set customer = sylius.customer|default(null) %} |
| 5 | +<script data-cfasync="false">const user_com_customer_info= { |
| 6 | + name: "{{ customer.name|default(null) }}", |
| 7 | + user_id: "{{ customer.email|default(null) }}", |
| 8 | + email: "{{ customer.email|default(null) }}", |
| 9 | + gender: {{ null != customer ? genderMap[customer.gender] : genderMap['u'] }}, |
| 10 | + status: {{ null != customer ? active : visitor }}, |
| 11 | + phone_number: "{{ customer.phone_number|default(null)}}", |
| 12 | + } |
| 13 | +</script> |
| 14 | +{% set apiAwareResource = getUserComApiAwareResource() %} |
| 15 | + |
| 16 | +{% if null != apiAwareResource and null != apiAwareResource.userComGTMContainerId %} |
| 17 | + <!-- Google Tag Manager --> |
| 18 | + <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': |
| 19 | + new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
| 20 | + j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
| 21 | + 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
| 22 | + })(window,document,'script','dataLayer',{{ apiAwareResource.userComGTMContainerId }});</script> |
| 23 | + <!-- End Google Tag Manager --> |
| 24 | +{% endif %} |
0 commit comments