Created
May 26, 2015 17:30
-
-
Save anonymous/6a6da531af6f387a4443 to your computer and use it in GitHub Desktop.
Custom Code for Google Analytics Remarketing on Shopify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Cart Page --> | |
| <!-- To be added before the closing body tag --> | |
| <script type="text/javascript"> | |
| var google_tag_params = { | |
| ecomm_prodid: [{% for item in cart.items %}'{{item.product.id}}',{% endfor %}], | |
| ecomm_pagetype: 'cart', | |
| ecomm_totalvalue: [{% for item in cart.items %}'{{item.line_price | money_without_currency }}',{% endfor %}], | |
| }; | |
| </script> | |
| <script type="text/javascript"> | |
| /* <![CDATA[ */ | |
| var google_conversion_id = 965357769; | |
| var google_custom_params = window.google_tag_params; | |
| var google_remarketing_only = true; | |
| /* ]]> */ | |
| </script> | |
| <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> | |
| </script> | |
| <noscript> | |
| <div style="display:inline;"> | |
| <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/965357769/?value=0&guid=ON&script=0"/> | |
| </div> | |
| </noscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Home Page --> | |
| <!-- To be added before the closing body tag --> | |
| <script type="text/javascript"> | |
| var google_tag_params = { | |
| ecomm_prodid: '', | |
| ecomm_pagetype: 'home', | |
| ecomm_totalvalue: '', | |
| }; | |
| </script> | |
| <script type="text/javascript"> | |
| /* <![CDATA[ */ | |
| var google_conversion_id = 965357769; | |
| var google_custom_params = window.google_tag_params; | |
| var google_remarketing_only = true; | |
| /* ]]> */ | |
| </script> | |
| <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> | |
| </script> | |
| <noscript> | |
| <div style="display:inline;"> | |
| <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/965357769/?value=0&guid=ON&script=0"/> | |
| </div> | |
| </noscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Product Page --> | |
| <!-- To be added before the closing body tag --> | |
| <script type="text/javascript"> | |
| var google_tag_params = { | |
| ecomm_prodid: '{{ product.id }}', | |
| ecomm_pagetype: 'product', | |
| ecomm_totalvalue: '{{ product.price | money_without_currency }}', | |
| }; | |
| </script> | |
| <script type="text/javascript"> | |
| /* <![CDATA[ */ | |
| var google_conversion_id = 965357769; | |
| var google_custom_params = window.google_tag_params; | |
| var google_remarketing_only = true; | |
| /* ]]> */ | |
| </script> | |
| <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> | |
| </script> | |
| <noscript> | |
| <div style="display:inline;"> | |
| <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/965357769/?value=0&guid=ON&script=0"/> | |
| </div> | |
| </noscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Purchase Page --> | |
| <!-- To be added before the closing body tag --> | |
| <script type="text/javascript"> | |
| var google_tag_params = { | |
| ecomm_prodid: [{% for line_item in order.line_items %}'{{line_item.sku}}',{% endfor %}], | |
| ecomm_pagetype: 'purchase', | |
| ecomm_totalvalue: [{% for line_item in order.line_items %}'{{line_item.price | money_without_currency }}',{% endfor %}], | |
| }; | |
| </script> | |
| <script type="text/javascript"> | |
| /* <![CDATA[ */ | |
| var google_conversion_id = 965357769; | |
| var google_custom_params = window.google_tag_params; | |
| var google_remarketing_only = true; | |
| /* ]]> */ | |
| </script> | |
| <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> | |
| </script> | |
| <noscript> | |
| <div style="display:inline;"> | |
| <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/965357769/?value=0&guid=ON&script=0"/> | |
| </div> | |
| </noscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment