Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi,

I am very new to ASP NET Core razor pages. I have a requirement to set up Google Tag Manager in ASP NET Core razor pages. Usually in the ASP.Net solution we use Google Analytic's tag.js script in page load. In angular we usually set up in app.module.ts/ app.component.ts.

But, I am to set up GTM tracking code/ id in ASP NET Core razor pages.

After set up, I need to send triggering conditions to GTM (like on button click send a event trigger to GTM so that it will in turn call the Google Analytics set up tag). Is there any helper class or plugins which I can use for the same ? Or in which file like Startup.cs , I can use the GTM configuration set up ?

Thank you.

What I have tried:

I have set up Google Analytics account and GTM account
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900