Laravel Google Analytics分析事件跟踪

问题描述

我将Laravel-GAMP软件包用于Google Analytics(分析)事件跟踪。但是问题是即使我的配置正确,我也检查了防火墙和cors。我的Google Analytics(分析)中没有显示任何数据。 这是我使用过的packgae:https://github.com/irazasyed/laravel-gamp 下面是我的截图。

enter image description here

为此,我使用以下代码

$gamp = GAMP::setClientId( '123456' );
$gamp->setDocumentPath( '/page' );
$gamp->sendPageview();

对于事件跟踪,我使用此代码

$uuid = (string) Str::uuid();
$gamp = GAMP::setClientId( $uuid );
$gamp->setEventCategory('Blog Post')
->setEventAction('Create')
->setEventLabel('Using GAMP In Laravel')
->sendEvent();

我使用Google Analytics(分析)扩展程序进行测试。 它说我无法连接。

enter image description here

解决方法

  1. 检查实时报告,确保其中显示匹配。如果他们等待24-48小时,则应显示在标准报告中。

  2. 如果点击量未显示在实时报告中,请转到Google Analytics(分析)帐户的“管理”部分,并确保关闭bot过滤功能。

  3. 我不是幼稚的开发人员,但您还应该记住,发送给debugEndpoint的任何内容都不会记录到Google Analytics(分析)中,仅用于调试,我相信该方案应该是https,但不是100%确定

Measurement protocol documentation.

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...