Jump to content

Add javascript (google tag) on target product page in PS1.7.x


Joey

Recommended Posts

In PS1.7.3 version, I want add the google tag which is written by javascript in some of products. Could anyone tell me how to do that? Thanks!

I knew I can insert code in footer / header tpl file but this method is work for all pages only, now I want add this code on some of product only. Can I insert this code in product edit page? 

Can it work if paste this code to product summary / description /  embed code ?

 

The code sample as below:

<!-- 
Start of global snippet: Please do not remove
Place this snippet between the <head> and </head> tags on every page of your site.
-->
<!-- Global site tag (gtag.js) - DoubleClick -->
<script async src="https://www.googletagmanager.com/gtag/js?id=XX-xxxxxx"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'XX-xxxxxx');
</script>
<!-- End of global snippet: Please do not remove -->

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...