
ASP.NET/C# Add Code to existing Website
- or -
Post a project like this896
£17/hr(approx. $23/hr)
- Posted:
- Proposals: 4
- Remote
- #3872637
- Awarded
Description
Experience Level: Entry
We currently add google tag manager code into the tag of the website. All websites share the same ‘site.master’ and many other files so the code is modified to take an ‘ID’ variable from the web.config file. The GTM code is only placed into the website once the cookie consent has been accepted. I can share code excerpts on first contact.
Current code looks like this, as an example of the type of project:
private void GoogleTagManagerTag(string id)
{
googleTagManager.Text = @"
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','" + id + @"');";
}
Current code looks like this, as an example of the type of project:
private void GoogleTagManagerTag(string id)
{
googleTagManager.Text = @"
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','" + id + @"');";
}

Electric IT Ltd
100% (24)Projects Completed
23
Freelancers worked with
17
Projects awarded
26%
Last project
3 Sep 2025
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
What do you want to tracking?
1052631
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies