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?
Thanks in advance!
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.
[quote name='tbirnseth' timestamp='1431804972' post='214613']
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.
[/quote]
Thanks tbirnseth,
I'm not a client, but sure could use the help …
So I create the file in this folder
[color=#000000]design[/color][color=#666600]/[/color][color=#000000]themes[/color][color=#666600]/[[/color][color=#000000]THEME_NAME[/color][color=#666600]]/[/color][color=#000000]templates[/color][color=#666600]/[/color][color=#000000]addons[/color][color=#666600]/[/color][color=#000000]my_changes[/color][color=#666600]/[/color][color=#000000]hooks[/color][color=#666600]/[/color][color=#000000]index[/color][color=#666600]/[/color][color=#000000]content[/color][color=#666600].[/color][color=#000000]pre[/color][color=#666600].[/color][color=#000000]tpl[/color]
[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]
Hey [color=#282828][font=arial, verdana, tahoma, sans-serif]tbirnseth,
I built the template above and put the following code in and the website hangs … am I missing something?[/font][/color]
Please check page source code (Ctrl + U) and check if the code exists there
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.
afreshup, if you need professional front-end developer, feel free to contact us
Hello,
I was wonder where could I find "content.pre.tpl" file on my cs-cart either on server files or on admin ?
You have to create it. Please search the knowledge base about using hooks. Then add the file
design/themes/[YOUR THEME]/templates/addons/my_changes/hooks/index/main_content.pre.tpl
And add whatever content you want there. Clear your cache (yoursiteadmin.php?cc) and you should be all set.
Hello All,
Just as an addon to this topic, am I correct in assuming this will not pass any ecommerce data through to Google Analytics?
You will need to disable the GA addon to avoid conflict with the Tag Manager GA code, then pass the order data on to the DataLayer in GTM.
Has anyone had any experience with this?
Regards,
Lucas
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.
Hi there i want to put "Add to cart event".
i want "add to cart event". Open Google tag manager site "add to cart" event and add "my cart links" there its enough?
or add something special code in "tagmanager code".
Thanks for all.
Can do only
add something but what???
Can do only
add something but what???
Hello!
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:
Thanks eComLabs. How to place code into tags?? I worked a little, but I did not.
Thanks eComLabs. How to place code into tags?? I worked a little, but I did not.
As tbirnseth said, advice is free, work is not. Sorry