What is the client ID when sending tracking data to google analytics via the measurement protocol?

前端 未结 3 794
一生所求
一生所求 2020-12-02 14:30

I want to use Google\'s new measurement protocol for sending tracking events from my server instead of JavaScript.

This page says the client ID is required: https://

3条回答
  •  离开以前
    2020-12-02 14:57

    In Rails:

      def save_google_analytics_client_id
        if current_user && cookies["_ga"]
          client_id = cookies["_ga"].split(".").last(2).join(".")
          if current_user.google_analytics_client_id != client_id
            current_user.google_analytics_client_id = client_id
            current_user.save
          end
        end
      end
    

提交回复
热议问题