Where to Add Google Remarketing Tag in Magento

I am trying to figure out in which file I need to add the Google remarketing tag. I know it needs to be added before the body tag is closed. Can someone point me in the right direction? Thanks to

+3


source to share


3 answers


this is what i have done in the past: Depending on which google tracking you are using, you can use several ways:

1) If you are adding only custom code and must be found on all Magento pages, use the value "Miscellaneous" in the admin section, System> Configuration> Design> HTML Head - Miscellaneous Scripts. (This will be included before the heading close tag in the HTML page.)

2) Native Magento already has Google Analytics tracking code and you can find this configuration under admin> Configuration> Google API - Google Analytics.



3) If you are looking for something a little more complex and are using Google adsWords I have used the magento connect link extension . For a specific Client, I made some additional modifications to include additional code if the client signed up for a newsletter or a new client, etc.

Hope you can find something helpful in the post.

Best, Gringo.

+1


source


There are different template files for different pages in magento, so first I think you have to decide where to place them. For example, if you want to put it in the footer, you should put this piece of code in

"app / design / frontend / base / default / page / html / footer.phtml"

Likewise, you can check other template files to put your code.



NB: It is best to override the main magento file before making changes to it.

Hope this helps.

0


source


There is no indication as to which version of Magento you are using 1 or 2. At the end of the day, it depends on how much technical knowledge you have and if you use a source control system to manage your Magento build.

  • Other scripts like another answer mentioned earlier, this approach is simple and very easy to use to connect and reproduce your code.
  • Google plugin, depending on which Magento version you are using (CE / EE), there will be an inline section for your account id plugin in the Magendo config on the backend, and then the platform will generate the necessary code for you.
  • Create your own module by writing your own module, you can place it anywhere on the page by setting up a before_body_end

    node in your XML layout file. It's more technical, but gives you more control over what you can do.
  • Google Tag Manager , it also depends if your Magento version will be preinstalled with the Google Tag Manager module, then you can create a container and place all your logic there. It's also more technical and requires some JS-formatted values ​​to be displayed on the interface for GTM to read the values.

At the end of the day, go with something that is easy to customize, carry, and manage . I usually work with Google Tag Manager, as it takes a while to initially configure how the data is displayed in the interface, but then I have complete control over what I want to do with that data through the tag manager. In most cases, you will be using the same data (e.g. totals, shipping method, product IDs, SKUs, cost, etc.) in more than one third party API, so this gives you the flexibility to do this.

0


source







All Articles