So I got my Google Analytics set up via Google Tag Manager. Page views tracking is working fine. But when I try to track any events, the data is just not getting through to Analytics. The event tracking did not work with traditional Analytics code either.
Analytics debug is showing several "Create config had an unknown parameter: x"
and "Command ignored. Unknown target: undefined"
Supposedly this means that there is something wrong with my tracker name. I have tried both default name and custom names.
Might be worth mentioning: Until recently, my site's default URL was wrong in Analytics site preferences, but I'm not sure if that has anything to do with this.
Analytics debug message:
Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("create", {2: null, 3: null, 6: "1", 10: false, 11: false, 12: false, 16: false, 17: false, 18: false, 28: false, 32: "UA-1439995-1", 33: false, 34: false, 35: [{fieldName: "cookieDomain", value: "auto"}]}, {name: "gtm5"})
analytics_debug.js:10 Creating new tracker: t0
analytics_debug.js:10 Create config had an unknown parameter: "2"
analytics_debug.js:10 Create config had an unknown parameter: "3"
analytics_debug.js:10 Create config had an unknown parameter: "6"
analytics_debug.js:10 Create config had an unknown parameter: "10"
analytics_debug.js:10 Create config had an unknown parameter: "11"
analytics_debug.js:10 Create config had an unknown parameter: "12"
analytics_debug.js:10 Create config had an unknown parameter: "16"
analytics_debug.js:10 Create config had an unknown parameter: "17"
analytics_debug.js:10 Create config had an unknown parameter: "18"
analytics_debug.js:10 Create config had an unknown parameter: "28"
analytics_debug.js:10 Create config had an unknown parameter: "32"
analytics_debug.js:10 Create config had an unknown parameter: "33"
analytics_debug.js:10 Create config had an unknown parameter: "34"
analytics_debug.js:10 Create config had an unknown parameter: "35"
Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("gtm5.set", ">m", "G32NJ6NK7K")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("gtm5.set", "nonInteraction", false)
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("gtm5.set", "hitCallback", [function])
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("gtm5.send", {hitType: "event", eventCategory: "contact-form", eventAction: "successful-form-submission-mailsent", eventLabel: "362", eventValue: undefined})
analytics_debug.js:10 Command ignored. Unknown target: undefined
Analytics debug message screenshot
I believe I have found a solution.
I edited my Universal Analytics tags (Contact Form Submission and GA-Pageview) in GTM by setting tracker names to blank.
(Edit Tag -> Enable overriding settings in this tag -> More Settings -> Advanced Configuration -> Set Tracker Name [True]
I have no idea why I had to do this and if this is a good solution. But now event tracking seems to work.
I had this same problem. I had set my variable " tracking id" to type google analytics settings, instead of constant. Changing to constant removed this strange create function.
This is part of the answer: when you create your tracker initially, although you assign the name gtm5, the tracker is assigned the default name t0. Therefore when you refer to gtm5 in the later calls gtm5.set, it fails, and that's the error you're getting (Command ignored. Unknown target: undefined, target being the tracker name you're referring to).
Now what I don't understand, is that the screenshot you provided, the Google Analytics settings look pretty much standard, whereas in the debug, we see custom fields trying to be assigned ({2: null, 3: null, 6: "1", 10: false). GA seems confused by that syntax, hence why it ignores your {name: "gtm5"} option and assign the default t0 name.
Are you sure the screenshot you provided is related to the debug we see (for me it doesn't seem like so, the GTM debug mode would help you find out).
The reason for this is that you have added a Google Analytics Settings variable into a field named “Tracking ID”, either in the tag itself or the settings variable used in the tag.
The field named “Tracking ID” can never have anything else except a string “UA-XXXX-Y” or a variable that returns said string (e.g. Constant, Lookup Table).
The Google Analytics Settings variable doesn’t return “UA-XXXXX-Y” but rather a configuration object. That’s why you see the errors.
Fix the Tracking ID field and your tag will work.
Related
I have a Lambda service that was created with Serverless. I recently upgraded to Serverless 3. (3.22.0 specifically.) I'm also using serverless-offline 8.8.1 and serverless-domain-manager 4.2.3.
It seems to be "stuck" in a state where the domain cannot be deleted or re-created.
After the upgrade, publishing to my prod stage would fail with:
Serverless Domain Manager: Info: api-prod.example.com: Found apiId: pnedwg0m9b
Serverless Domain Manager: Error: api-prod.example.com: ConflictException: Base path already exists for this domain name
Serverless Domain Manager: Error: api-prod.example.com: Error: Error: api-prod.example.com: Unable to create basepath mapping.
...
Error: Error: Unable to setup base domain mappings for api-prod.example.com
The domain settings in serverless.yml look like this:
custom:
customDomain:
domainName: api-${opt:stage, 'dev'}.example.com
basePath: ''
stage: ${self:provider.stage}
createRoute53Record: true
After searching online, I thought the issue might be that the domain was created with an older version of serverless, so I manually deleted it in the Route53 section of the AWS console, then waited overnight. It doesn't appear in the console now.
I tried to re-create it by doing both:
Having createRoute53Record: true in the serverless.yml and running:
SLS_DEBUG=* serverless deploy --verbose --stage prod
This gives the same "unable to setup base domain mapping..." error as before.
... and also manually creating it:
SLS_DEBUG=* serverless create_domain --verbose --stage prod
That just gives the following error, despite the fact that the domain is not visible in the AWS console:
Custom domain api-prod.example.com already exists.
If I try to delete it via serverless, it also throws an error:
SLS_DEBUG=* serverless delete_domain --verbose --stage prod
Serverless Domain Manager: Error: api-prod.example.com: InvalidChangeBatch: [Tried to delete resource record set [name='api-prod.example.com.', type='A'] but it was not found, Tried to delete resource record set [name='api-prod.example.com.', type='AAAA'] but it was not found]
Serverless Domain Manager: Error: api-prod.example.com: Error: Error: Failed to DELETE A Alias for api-prod.example.com
Some other notes:
The "development" stage doesn't result in any errors when deploying. (I created the domain with the create_domain command, but even with createRoute53Record:true, it deploys without error.)
I've tried bumping serverless-domain-manager to 6.1, but that didn't help.
The api-prod.example.com is not present in neither Route53 nor in API Gateway>Custom domain names.
Not sure if it's relevant but this same API was exposed by both api-prod.example.com and api.example.com. I'm not sure how the api.example.com one was created.
I am trying to create a simple app that will output the payload after the webhook "pull_request_review_thread" is triggered with any action. Here is the link to the related webhook: Pull_request_review_thread Github Docs
However, this code:
app.on("pull_request_review_thread", async(context) =>{ app.log.info(context.payload); })
gives the error:
Argument of type '"pull_request_review_thread"' is not assignable to parameter of type 'keyof EventTypesPayload | (keyof EventTypesPayload)[]'
Am I missing something?
The problem was not having the latest version of #octokit/webhooks-types. It can be checked with the command "npm ls #octokit/webhooks-types" , current latest version is 5.8.0
I am trying for quite some time now to disable the profiler in the test-environment. The only way it works is manually setting APP_ENV=test in file .env but I want to do this through the command line, not by editing a file.
Here's everything I tried:
I tried editing bin/console like described in Chris Brown's answer in this thread: Load different .env file with a Symfony 4 command (I also added the file .env.test, and according to xdebug it loads the appropriate file and runs through the appropriate code and also the variables $env and $debug get the appropriate value when I run the server with --env=test --no-debug)
I tried setting profiler: enabled: false like described in flu's answer in this thread: How to disable profiler in Symfony2 in production? (in config/packages/test/framework.yaml)
I tried setting the profiler line in bundles.php to
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true],
and to
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => false, 'test_cached' => false],
I tried those solutions separately and also all together, still the profiler keeps popping up. Does anybody have an idea?
EDIT:
After applying Alister Bulman's answer the command gives me this:
#php bin/console -e test debug:config framework profiler
Current configuration for "framework.profiler"
==============================================
enabled: true
collect: false
only_exceptions: false
only_master_requests: false
dsn: 'file:%kernel.cache_dir%/profiler'
EDIT 2:
Thanks to Jared Farrish I just found out the browser is receiving the website in "dev" mode although the server is started in test environment on cli. Obviously editing bin/console and public/index.php is not enough, they're not called when the server receives a request from the browser.
EDIT 3:
So I found out the http request goes first to public/index.php, but whatever I do, I cannot seem to make anything available there which was defined in bin/console although the whole server is started there in the first place. Anyone an idea how this can be done?
The profile can be enabled, or disabled in the framework configuration.
> bin/console -e dev debug:config framework profiler
Current configuration for "framework.profiler"
==============================================
only_exceptions: false
enabled: true
collect: true
only_master_requests: false
dsn: 'file:%kernel.cache_dir%/profiler'
In a newly generated project, these are best set (for the test environment) in the config/packages/test/framework.yaml file.
framework:
profiler:
enabled: false
collect: false
# optionally others
Documentation for the framework config (profiler, and the rest) is at https://symfony.com/doc/current/reference/configuration/framework.html#profiler
I found it myself. What I did was use a functionality of php.ini which is called "auto_prepend_file" where you can specify a PHP file which gets executed automatically before the actual PHP content is executed. So in there I put a path to a file with following content:
<?php
$_ENV['APP_ENV'] = 'test';
$_ENV['APP_DEBUG'] = 0;
I am running a nodeJS server on Ubuntu 14.04 in Google Compute Engine. I want to use google cloud logging for my application so I installed google fluentd logging agent as per https://cloud.google.com/logging/docs/agent/installation
I used winston and winston-syslog for writing logs. Here is the code.
var winston = require('winston');
var winstonsyslog = require('winston-syslog').Syslog;
var options = {
json : true
};
winston.add(winston.transports.Syslog, options);
When I am writing a log using
winston.log('info', "27", { anything: 'This is metadata' });
I am getting
{
metadata: {…}
textPayload: "May 14 10:47:44 localhost node[7633]: {"anything":"This is metadata","level":"info","message":"27"}"
insertId: "..."
log: "syslog.local0.info"
}
How to get structPayload instead of textPayload which displays log as JSON instead of String.
Logging agent has it's own configuration files, and most of them have format none (see https://github.com/GoogleCloudPlatform/fluentd-catch-all-config). Thus, all log lines go to textPayload.
The solution is to write your own fluentd configuration file and use fluent-plugin-google-cloud as output. fluent-plugin-google-cloud should be installed as a gem directly, not using Logging Agent As long as your entry is a valid JSON, you will see that entry on Stackdriver having structPayload set properly. Key/value filters work as well.
I have never used winston, but here is sample configuration:
<source>
#type tail
format apache
path /var/log/apache/access.log
tag apache.access
</source>
<match **>
#type google_cloud
buffer_chunk_limit 10k
</match>
Notice the buffer_chunk_limit 10k, setting it to values too big or leaving it at default may result in Google::Apis::ClientError badRequest: Request payload size exceeds the limit.
I am trying to create heat stack using yaml file in tempest.
I have 2 yaml files.
I have to execute first file. Second file is refered in the first file
server_group autoscale group and it's init contents to generate load
scale_group:
type: OS::Heat::AutoScalingGroup
properties:
min_size: 1
max_size: 3
resource:
type: SimpleServerWithPoolMember.yaml
I get below error when i run the function
StackBuildErrorException: Stack e3f16f15-6001-4404-a7c0-999fc114df1b is in CREATE_FAILED status due to 'Resource CREATE failed: StackValidationFailed: Could not fetch remote template 'SimpleServerWithPoolMember.yaml': Invalid URL scheme '
This is a known bug for openstack-heat, and it can be reproduced on version 0.2.8.
If you want to avoid this issue, my suggestion is try to update your version to 0.2.12.