Google Analytics 4 Measurement Protocol/Postman POST Request 403 Error - postman

I'm attempting to send a POST request to my Google Analytics 4 property directly from Postman. My current request looks like so:
However, when I attempt to send this request I am met with the following output:
<a href=//www.google.com/> <span id=logo aria-label=Google></span></a>
<p><b>403.</b> <ins>That’s an error.</ins>
<p>Your client does not have permission to get URL
<code>/mp/collect?measurement_id=G-xxxxx&api_secret=_xxxxxx</code> from this server.
<ins>That’s all we know.</ins>
I'm currently referencing this documentation provided by Google.
Any idea how/why this could be happening? I triple-checked my secret/measurement ids.
Thanks!

I just had the same issue, but this was because I had disabled the host header. You might want to check the headers tab to see if you have enabled the host header. If you don't see the default headers in that tab, click on the button to show the default headers.

Related

500 internal server error instead of 302 redirect- JMeter

I'm trying to investigate the issue as I mentioned in the subject.
I login to the application and successfully able to land on the home page of my application through my JMeter code.
When I click on "user details" tab , I should be redirected 2 times.
Successfully able to redirect for the first time. For the second redirection I'm getting 500 error code instead of 302 again.
URL for "User details" is a plain URL, doesn't come with any need of correlation.
I have cookie manager with "standard"( tried all other options also on cookie manager)
I see that - cookie value SameSite=None; is also seen at request body along with other values only during the reply of my script(I do not see this in the recorded traffic/even if I cross verify using fiddler).
Would like to know if this can be a problematic. If so how can I remove this.
Try playing with Redirect Automatically and Follow Redirects boxes in the HTTP Request sampler
if it doesn't help - be aware that you can extract the redirect URL from the Location header using Regular Expression Extractor
If you think that the problem is with the cookie you can enable debug logging for the HTTP Cookie Manager by adding the next line to log4j2.xml file (lives in "bin" folder of your JMeter installation:
<Logger name="org.apache.jmeter.protocol.http.control" level="debug" />
this way you will be able to see what's going on under the hood in jmeter.log file as it might be the case that the cookie is broken somehow (expired, wrong path, etc.)

Stripe Connect Express - Callback URI for Localhost Doesn't Seem to Work

I'm trying to set up a platform that uses Stripe, and since I need marketplace type of setup I'm using Connect, which does payments and payouts.
I'm testing on local and the redirect URLs I've tried don't seem to work. After registering with Stripe, I'm still taken to their default redirect URI, which says:
Congrats, you're almost done setting up your application! After
connecting with Stripe, your users will be redirected to a page of
your choosing (this is just the default). Make sure to change the test
redirect URI under your application settings to something that makes
sense on your own server (or localhost).
However, I have tried all of these as redirect URIs in my Stripe Connect Dashboard, under the 'testing' option:
http://localhost:8000/test-stripe/connect/default/oauth/test
http://localhost:8000/test-stripe/oauth/callback
http://localhost:8000/test-stripe/
These are supposed to be the URI that Stripe redirects back to on my site, with an added parameter at the end.
Am I missing something? I find their documentation labyrinthine, as you have to click on link after link to get one part of their solution working, and then see if you can find your way back to where you left off. Maybe I missed something along the way.
The test link to Stripe:
<script
src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha256-pasqAKBDmFT4eHoN2ndd6lN370kFiGUFyTiUHWhU7k8="
crossorigin="anonymous"></script>
<h2 style="margin-top:50px;">Testing Stripe...</h2>
{% csrf_token %}
<a id="test-stripe" href="https://connect.stripe.com/express/oauth/authorize?redirect_uri=https://stripe.com/connect/default/oauth/test&client_id=ca_FXp5f7CsYa0ddYm2Jri4zflYuMIPp5wT">stripe</a>
<script>
var token = $("input[name=csrfmiddlewaretoken]").val();
var stripeLink = document.getElementById("test-stripe");
stripeLink.href = stripeLink.href + "&state="+token;
</script>
Thanks in advance for any tips.
Solved. I still had Stripe.com's redirect_uri parameter in the URL - oops.

GET request 200 OK but 'failed to load response data' for links

I made a personal website (http://www.soyoungpark.online) using domain bought from GoDaddy and hosted on AWS s3. I set up everything and thought things were working until I put a simple link to my linkedin profile. When I check the network panel, I see that status code is 200 OK but for the response..there is nothing. The code itself doesn't seem to be problematic; it is simple a with href of the desired link. So I am guessing something could be wrong with my AWS s3 settings? Anyone with similar experience?
It's likely that these services include a header option called "X-Frame" that for security prevents them from being loaded within another site:
The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe> or <object> . Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites. Source: X-Frame-Options
This does look to be the case when attempting to view Linkedin per your example:
Refused to display 'https://www.linkedin.com/in/exampleuser' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
That said, applying a target Attribute to each to open in a new tab or window should allow these outside services to be navigated to.
e.g:
<a href="https://www.linkedin.com/in/exampleuser" target="_blank">

Troubles with partial content nginx

I get some video files from server and use in templates like this:
<div class="player-block" ng-if='hasSubscription(episode_detail.season)'>
<video ng-if='episode_detail' id="serial-video" class="video-js" controls preload="none" height="450" data-setup="{}">
<source ng-src="{{episode_detail.video_mp}}" type='video/mp4'>
<source ng-src="{{episode_detail.video}}" type='video/webm'>
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that
supports HTML5 video
</p>
</video>
</div>
my nginx config:
Thats what i mean, try to rewind video in google chrome:
http://185.143.173.143:8000/media/SPONGEBOB_TRAP_REMIX_KRUSTY_KRAB_Vine_Remix.mp4
The result is not working in chrome rewind , I read that it is necessary to configure the server to return partial content.How do I configure nginx for this?
You have max_ranges set to 0, which will disable Range request handling in nginx. The simplest thing to do would be to remove that max_ranges 0 line. However, that still might not work if the origin (185.143.173.143) does not honor the Range requests.
In order to test if the origin (185.143.173.143) itself supports range requests, you will want to use curl from your nginx machine:
curl -I -r 0-100 http://185.143.173.143/path/to/video
If the Range request worked, the status will be something like 206 Partial Content and there will be a Content-Range header indicating the requested range. The Content-Length should be 101 in this case. If you get a 200 then likely your actual origin itself does not support range requests, and you will have to debug the configuration there.

RestFB - Picture URL is not properly formatted

I'm trying to publish a post on my facebook page using RestFB.
My code is as follows:
FacebookType publishResponse = facebookClient.publish(pageId + "/feed", FacebookType.class,
Parameter.with("message", message),
Parameter.with("picture", picture),
Parameter.with("link", link),
Parameter.with("description", description));
And my parameters have the following values:
message: Test+test+test
picture: https%3A%2F%2Fcom-smallteaser-local-photo.s3.amazonaws.com%2Fskydivemag%25232fdefcfa-c7b2-4c0d-8504-9942ccd9a4b0%2523648%25230%25232592%25232592%2523292%2523292
link: http%3A%2F%2Flocalhost%3A9000%2Farticle%2F20130503-test-test-test
description: This+is+just+a+test
I am getting the exception:
FacebookOAuthException: Received Facebook error response of type OAuthException: (#100) picture URL is not properly formatted]
I read here that i can add a picture with just providing an URL and it specifically says that it is meant for 'App developers who host their images on Amazon S3 or a similar service'.
Any idea what i'm doing wrong?
I think it’s not actually the “formatting” of the picture URL, but the content it returns:
https://com-smallteaser-local-photo.s3.amazonaws.com/skydivemag%232fdefcfa-c7b2-4c0d-8504-9942ccd9a4b0%23648%230%232592%232592%23292%23292
is delivered with a Content-Type: application/octet-stream response header (as you can see here) – and that might make Facebooks scraper think that this is not really an image resource.
So you will have to figure out how configure your hosting space to deliver these images with a correct Content-Type, for example img/jpeg or img/png.
I got this problem, but only on older Android devices, not on a desktop. I could see in the server logs that there was a difference:
When accessing the URL on a desktop, Facebook does request the picture URL.
When accessing the URL on an older Android device, Facebook does not request the picture URL.
It turned out that I was using window.location.origin in constructing the absolute URL, which according to http://www.hyperink.com/blog/?p=18 only works on Webkit. It was solved by replacing, as the post suggests,
window.location.origin
by
window.location.protocol + “//” + window.location.hostname