Google Analytics not filtering internal traffic - django

I know there have been similar questions in the past but I have tried many solutions given online to no avail. I am just not able to hide internal traffic for Google Analytics on my Django site.
I am setting the filter from Admin->View->Filters. Have tried Predefined and Custom both with fixed IP as well as a regex pattern. (Yes, I have double checked my IP from whatismyip.com and I am using the right one)
I read somewhere that it takes time for the filters to come into effect, so even waited for 24 hours but I still see a lot of internal traffic.
Google Tag Assistant is also tracking the pages when I access them from internal IP (not sure if its supposed to know about the filters)
Not sure where could I be going wrong.
(I am using reverse proxy but hopefully that wouldn't change anything since the google analytics code is run on the client side)

Do not use any filter on the default view (called 'All Website Data'). Create a separate view and then create a filter on it. That will work.
(After struggling with it for a few days, this response helped me with the above fix)

I struggled with this as well, so here is what I found out.
Note that real time reporting can take up to 2hrs to catch up to and reflect analytics configuration changes such as the addition of filters.
Possible solutions
1) As suggested in the other answer, leave the default view as default and create an additional view for the filters:
The default view collects
all traffic. You need to create a new view for which you can apply
your filter. Check out item 3 here
https://support.google.com/analytics/answer/1009618?hl=en
How to add
a new view: https://support.google.com/analytics/answer/1009714?hl=en
2) Filter IP v6, not v4:
Exclude the ipv6 address as mentioned in above post. This is the one
that "what is my ip address" returns. It's not the ipv4 syntax
(xxx.xxx.xxx.xxx) However, I have noticed that wired machines that
stay connected seem to keep the same ipv6 IP (the 31 digit sequence),
however wireless accounts (mobile phones, tablets) tend to be dynamic.
However, as posted above if you use just the first 15 digits of the
sequence and use the "begins with" filter type, it will block
the devices using the same shared router (ie. internet router in your
home)
About filtering only the first 15 digits:
I think it is meant to filter the first four blocks, so if your IPv6 looks like 2601:191:c001:2f9:5c5a:1c20:61b6:675a, then filter IP that begins with 2601:191:c001:2f9:.
Information found here.

Related

How to show dynamic information in Grafana panels

I'm configuring panels in Grafana, but the display shows a little more information than I would like.
Ideally, I only want to see the IP address and the value, like this, without the instance ID.
At the moment, I'm only able to do this using overrides and manually hardcoding the value I want to see, in this case, the private IP address.
Is there a way to have this dynamically generated, sort of how you would use variables in the Dimensions, so that each panel shows the value and private IP address of the instance being visualised, so that I don;t have to manually update this across so many instances.
I'm using Grafana 9.0.x
I'd have thought this would be possible using Legends, but I can't seem to find the Lengend in this new version of Grafana.
I can see the option to add a Label, but I don't see any way to create one using the privateIP variable I've created.
You can use Rename by regex from the Transformations for that.
Go to the tab Transform, select Rename by regex, enter a regex that matches all IP addresses in the Match field and replace the initial name with the match. An example can be found in the docs.

Replicating data from SQL Server to BigQuery

I've been trying to follow instructions from Google on Replicating data from SQL Server to BigQuery available here: https://cloud.google.com/data-fusion/docs/tutorials/replicating-data/sqlserver-to-bigquery. Following instructions to the letter step by step always results in this odd error when creating the Cloud Fusion instance
Invalid argument (HTTP 400): retry budget exhausted (3 attempts): cloud-control2-saas::GCE_BAD_REQUEST: Invalid value for field 'networkPeering.name': '*******'. Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)'.
**** is the project ID with the VPC network suffix after a dash and it looks a bit like this (I've changed values)
website.com:api-project-0000000000-default
This value is being assigned somewhere by Google, I am not given a choice to select this or enter this through the instructions when creating the Instance.
Googling the error doesn't show me anything useful and sadly I do not have budget to acquire GCP support in this instance to try and ask them why their instruction appear not to work.
I've already checked quotas, billing, service account permissions, etc. I've also tried both a new VPC as well as a shared VPC with all the settings from the guide.
Would appreciate someone more experienced in this area maybe point me in the right direction or if someone has some sort of understanding of where else to check what could be wrong I would appreciate it.
Instructions do point at creating a peering connection but the instructions themselves require the Cloud Data Fusion Instance to be created before configuring the peering connection and since I can't create the Cloud Data Fusion Instance I am unsure on what exactly I am supposed to do.
Appreciate the help!
According to this documentation, before creating a private instance I assume you're creating a VPC network.
networkPeering.name is a combination of your Project-id and VPC-network. The error which you're getting is due to incorrect naming convention of networkPeeering name. ie. the value of networkPeering.name does not match the regex expression (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?), which in your case is due to the project-ID: website.com:api-project-xxxxxxxxx.
Also note that networkPeering name should be less than 63 characters in length as per the regex expression.

How to add external email addresses to AWS WorkMail Group?

I can create a group on the Amazon WorkMail console and add internal users to the group. However, I do not see an option to add external email addresses with different domains.
Any tips on how to do this? Should I just create an email forwarding rule on an internal user?
Unfortunately, at present, this isn't possible (more info below). So, your proposed solution of creating an email forwarding rule is likely the best solution.
One thing to note is that you may want to set up email redirect rather than email forwarding. If you redirect, the end recipient will see the email as coming from the original sender and addressed to the original recipient, as opposed to being forwarded. In WorkMail, you'll find redirect as one of the options, alongside forwarding, when setting up the rule(s).
One additional tip for setting up the redirect/forwarding rule. There's no condition in the rules setup to just forward everything. Because of that, you'll likely want to create 2 rules. The first rule would use the condition has my name in the To box and the second rule would use the condition Does not have my name in the To box. This should have you covered for just redirecting/forwarding everything. Fortunately, you can redirect to multiple destinations, so you can probably get away with just these 2 rules even if you have multiple final destinations.
Additional info about not being able to add external addresses to groups:
An AWS team member has stated that this isn't currently supported in this AWS forum post from 2017:
Indeed, it not possible to add an external email address to a group. I will forward this feature request to the service team.
A possible workaround is to create a redirect rule that redirect emails sent to this group to the external users.
As of today, you still get the following message when adding members to a group (console screenshot):
You can only add users and groups that are enabled for access to Amazon WorkMail.
[Edit, 2021-01-17: Tips on bulk addition of email addresses to a rule]
Bulk addition of email addresses to a rule
Unfortunately, there don't currently appear to be any APIs to create inbox rules programmatically. However, you can copy-paste a large number of emails into a rule.
First, you'll want to export the set of email addresses you have into e.g. a CSV file.
Then, you'll want to append a ; to each email address. The reason for this is that the character is recognized as a separator. If we don't use it, the email rule will interpret the entire pasted text as a single email address. As an example, in Google Sheets, this can be done with CONCATENATE. E.g. =concatenate(A1,";"). Here's a screenshot:
Next, open the email rule, copy the email addresses from the spreadsheet, paste them into the recipients box, and click the To button. In this case, it's 100 emails, so it takes a little bit of time to load:
Once it finishes loading, you'll see checkboxes next to the email addresses, like when you add single email addresses manually.
Make sure to click Ok on the recipients dialog, then click Ok on the rule dialog, and finally click Save changes on the Email Rules Settings panel to ensure everything gets saved.

Google Analytics local IP filter not working

I am trying to filter out traffic from local IP address from my development machine. I have created a separate view in Admin panel for this. I have entered /(localhost)|(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/ in Admin Panel > View > Filters (as shown in image below).
I am doing something wrong here? Is my regex for Local IPs correct? Thanks
This regex should cover all the cases (but it exceeds 255 characters):
/(^192\.168\.([0-9]|[0-9][0-9]|[0-2][0-5][0-5])\.([0-9]|[0-9][0-9]|[0-2][0-5][0-5])$)|(^172\.([1][6-9]|[2][0-9]|[3][0-1])\.([0-9]|[0-9][0-9]|[0-2][0-5][0-5])\.([0-9]|[0-9][0-9]|[0-2][0-5][0-5])$)|(^10\.([0-9]|[0-9][0-9]|[0-2][0-5][0-5])\.([0-9]|[0-9][0-9]|[0-2][0-5][0-5])\.([0-9]|[0-9][0-9]|[0-2][0-5][0-5])$)/gm
This should cover all the above cases but is more optimized:
/^(?:10|127|172\.(?:1[6-9]|2[0-9]|3[01])|192\.168)\..*/

Is it possible to purge an entire directory with the Akamai CCU REST API using a wildcard?

I think the title says it all. We have a site that uses a URL parts to specify locale, category, product, and product variation. For example:
/[country-code]/[category-slug]/[product-slug]/[variation-id]
As we support about 10 different locales, and some products have up to 30 variations, if we change a category, we can sometimes be trying to purge up to 1500 urls.
Is it possible using the Akamai CCU REST API to add a wildcard value, say for the country code, or variation id?
/*/[category-slug]/[product-slug]/*
I have seen some mentions of wildcards around but I'm not sure if they're supported by the API
This should be possible. When you go to CCU, click on "Refresh by Directory & File Extension". Hope this helps.
You can do a purge by CPCode.
I've just written a getting started guide for the CCU API:
https://community.akamai.com/community/developer/blog/2015/08/19/getting-started-with-the-v2-open-ccu-api?sr=stream
The only difference for your case is that you'll want to allow purge by CPCode, and set up a CPCode for the file areas you want to purge at once.