Hello, I have decided to use Google Tag Manager on one of our sites that we do a lot of marketing for to consolidate all of the scripts that are needed to be run.
First of all, if you think this is a bad idea, I'd like to hear your opinion …
I would like to know the best way to implement it. GTM is placed behind the opening tag … Should we make a hook, or edit a template?
Either way, I need someone to be kind enough to show me how to do this … any helpers out there?
For our clients, we use a “content.pre.tpl” hook and put the iframe code there. It's a few lines below the body tag, but it does come before any real content that you would want to track.
For our clients, we use a “content.pre.tpl” hook and put the iframe code there. It's a few lines below the body tag, but it does come before any real content that you would want to track.
[size=4][color=#000000]and from there I put the code in [/color][color=#000000]content[/color][color=#666600].[/color][color=#000000]pre[/color][color=#666600].[/color][color=#000000]tpl … is that it?[/color][/size]
I always change any '{' characters to smarty {ldelim} and '} to smarty {rdelim} to avoid complications. If you are not using any smarty variables in your code, then you can put {literal} above the code and then {/literal} at the end to accomplish the same thing. You probably have info in your error_log file related to whatever problem exists.
THANKS MAN! [color=#282828][font=arial, verdana, tahoma, sans-serif]{literal} [/font][/color][color=#282828][font=arial, verdana, tahoma, sans-serif]{/literal},did the trick … what does your company specialize in? Do you do custom coding … add ons and stuff?[/font][/color]
You are welcome and yes, we do custom development of addons and other backend related functionality (B2B or administrative extensions). We tend to shy away from frontend work since it's too unstable from our perspective (I.e. changes too often and I hate fighting with css). Hence we focus on backend extensions and general purpose addons and integrations. You can visit our site for a review of what we do and what we've done. We've been working exclusively with cs-cart since Beta of V2.0 so we're pretty well versed in how it all works, what's changed over time and sometimes even where they are headed. Our site is at https://ez-ms.com. If you have a specific need, then you can simply click the Get A Quote link in my signature.
Yes, you have to disable GA and then add gtm-data and gtm-info tags throughout the site to get reasonable data. You also have to add a bunch of JS if you want to get clicks with data recorded properly and also to separate promotions, impressions and clicks.
I did a complete implementation for one client who was using a 3rd party team for analysis. It took well over a month to get it all done, tested and sorted out and there were probably 40 template files that needed to be changed.
Definitely not a project for the upgrade-minded nor for the faint at heart.
There's probably a minimal amount you can do that will get order data captured and general navigation. But to get good detail is a highly invasive process.
It is much easier to install our Google Tag Manager add-on rather than make these changes by yourself, moreover there is a discount on this add-on now. Look what events are already working: