Google跟踪代码管理器服务器端跟踪.NET [英] Google Tag Manager server side tracking .NET

查看:165
本文介绍了Google跟踪代码管理器服务器端跟踪.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要从服务器端的.Net(C#)应用程序推送数据层,触发事件等。



Google跟踪代码管理器包含JavaScript,Android和iOS SDK 。它也有REST API,但是这个API只允许管理容器,标签和事件,但不允许跟踪它们。

跟踪GTM?似乎应该是因为存在SDK的手机存在,它应该没有太大的区别。



如果可能,请让我们知道如何,也许有API存在对于那个或.Net的.Net存在或将来计划。也许我们必须直接将数据推送到Google Analytics和其他端点?正如我所看到的,JavaScript SDK直接将数据从页面推送到GA。 解析方案



GTM不是一个跟踪工具(尽管它可以用来帮助实现实际的跟踪工具),它是一个标签管理系统。这就是为什么它只能在客户端运行(浏览器JavaScript,Android / iOS SDK都是客户端运行时环境)。您所指的REST API是一个管理API,用于自动执行通常通过GTM GUI手动执行的任务,但不会改变GTM的工作方式(即客户端工具)。



在GTM中使用服务器端代码

有几种方法可以编写服务器端代码以与GTM,但最终必须导致一些代码在客户端幻灯片上进行评估。以下是一些示例:
问题/ 553813 /如何做,我给JavaScript的变量,数据从ASP网络变量>通过.NET的JavaScript变量,然后你在客户端读取(或者你可以创建dataLayer代码直接遵循相同的方法)

  • AJAX调用:您可以使用客户端对您的服务器进行AJAX调用,并使用服务器响应来触发事件,创建变量和标记。 Web套接字:您可以使用套接字从您的服务器推送通知,并再次使用这些触发事件,创建变量和标记。



  • 但是,不管你在服务器端做什么,它都必须系统地导致第1个ing:代码在客户端进行评估。


    We need to push datalayer, trigger events and so on from .Net (C#) application from server side .

    Google Tag Manager has JavaScript, Android and iOS SDKs. Also it has REST API, but this API allows only to manage containers, tags and events, but doesn't allow to track them.

    So is it possible implement server side tracking for GTM? Seems it should be as there is SDKs for mobiles exist and it should be no big difference.

    If it is possible then please let us know how and maybe there is API exists for that or SDK for .Net exists or planned in future. Maybe we have to push our data directly to Google Analytics and other endpoints? As I can see JavaScript SDK pushs data directly to GA from page.

    解决方案

    Some clarifications first: GTM = Client Side
    GTM is not a tracking tool (although it can be used to facilitate the implementation of actual tracking tools), it is a Tag Management system. That is why it only runs on the client side (Browser JavaScript, Android/iOS SDKs are all client-side runtime environments). The REST API you are referring to is a management API to automate tasks you would normally perform manually via the GTM GUI, it doesn't change the way GTM works (that is, a client-side tool).

    Using server-side code with GTM
    There are several ways you can write server-side code to interact with GTM, but it ultimately has to result in some code being evaluated on the client-slide. Some examples:

    • Variables: you can create JavaScript variables via .NET which you then read on the client-side (or you can create dataLayer code directly following the same method)
    • AJAX calls: you can use the client to make AJAX calls to your server, and use the server response to trigger events, create variables, and tags.
    • Web socket: you can use a socket to push notifications from your server and once again use those to trigger event, create variables, and tags.

    But once again, no matter what you do on the server-side, it must systematically lead to 1 thing: code to be evaluated on the client-side.

    这篇关于Google跟踪代码管理器服务器端跟踪.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆