Tracking clicks on outbound links - tracking

I have a website based on wordpress. I want to implement a click tracking system on some of external links. Is there any method of doing so without using any external website or google analytic s.
Can't i call some external php script to run when the link is clicked and keep incrementing a variable everytime.
Please help . Thanks in advance

You can link to a script that tracks redirects and redirects the user.
outbound link
UPDATE: Don't forget to redirect with the status 301 to preserve the PageRank value added to the linked site.

Related

Vue + Flask Gmail API

I am attempting to build a webapp using Vue for the frontend and Flask for the backend that reads in the users Gmail emails.
Desired functionality:
User clicks a button to "Link Gmail Account" on the frontend
User is authenticated with gmail Oauth2 and confirms. Once confirmed, they redirect back to the page they were on
Once the user confirms, the backend queries gmail to get all of the users emails and returns the data to the frontend
I have been trying to use https://developers.google.com/gmail/api/quickstart/python as a starting point, but I cannot authenticate the user -- I keep getting a redirect uri mistmatch error with a random port (I am doing this locally so have set the redirect uri to be the localhost port where I access my project).
I think I am doing something fundamentally wrong or not using the Gmail API in the correct way, but have searched all over google and youtube to no avail.
Specific things that I think could be causing an issue:
What is the best overall strategy to implement this? Should I use the Gmail API in Python or Javascript? Right now, the use clicks the "Link Account" button which calls an API in my backend which then runs the code in the Python Quickstart guide.
What kind of google project should I set up? I currently have my credentials configured for a "web application"
What should I put as the redirect uri? I am using localhost but am unsure exactly what to put here (I have tried http://localhost, http://localhost:5000, http://localhost:5000/, http://localhost:5000/emails [this is the url I want them to return to]). No matter what I put, I keep getting a redirect uri mismatch and it says the uri it is looking for is http://localhost:[random port]/
I would appreciate any help on how to approach achieving this. Thank you!
Depending on what you are going to use Gmail API for, you must select the device or category. In your case, as it is a website it should be set to "Web Application".
Also, you should be using the following redirect URI: http://localhost/emails/. You should not include the port number and you should be using trailing slashes (adding the last / at the end). Note that the redirect URI you set up in your backend must be an exact match of the one you have set up in your Credentials Page. Also please note that it might take some minutes to update this URI.
Moreover, this is a guide on how to create a Sign In button that will authorise your users that I believe will be useful for you.

How can you rewrite an internal link access from external hostname?

What if I have some internal links on my xampp web server that need to get accessed by external (requests from the internet)?
Lets say http://mylocalsite.local/login/ is a link on the site.
if I click on this link from http://externalwebsiteaddress.com, which should redirect to my webserver. Can the internal link (mylocalsite) be rewritten to http://externalwebsiteaddress.com/login ? Because currently external requests give a "Cannot access this page error" because its internal.
I don't want the internal link to redirect to the external link when accessed from within the network.
Basically if the links are internal , then find a way to service the request from external website successfully, without having to physically change the link on the server.
in other words
If the user is accessing from an external internet link, then find a way to redirect to proper folder using external link so it can be resolved properly.
EX: All links start with http://externalwebsiteaddress/wherever
If user is accessing from internal (inside the network) , then use the local links.
EX: All links start with http://internaladdress/wherever
Would this be a mod_rewrite? I am confusing myself way to much.

Url rewrite for an existing website

I hope this is not a very stupid question. I have to rewrite the url's of an existing website. I have never done that before, so I'm a little bit confused. I have allready written some rules that make a page like faq.php be accessible also by entering only faq without the .php extension, but the page fap.php it's still accessible and in the footer when I move the mouse over the faq icon the link shown in the browser is faq.php. To make the browser display faq and not faq.php do I have to change the href link in the page manually or there is another way?
For example: in this website(stackoverflow) when you move the mouse over questions, tags, users or other links, the browser displays only /questions (or the others) without .php(or whatever they used to built the website). How can I achieve that?
What you see in the status bar is what your server sends to the browser.
To remove .php from faq.php you must either
send only faq (PHP) or
replace the contents of href attributes on the client side (JavaScript).

How to Inform Google For Page URL Modifications in Same Domain?

I am renewing my web page and changing the site structure. It was in Asp and now it will be in Asp.Net
So page URLs will be modified. And some pages will be removed, some will be added. But mostly, the content and page names are same, only URLs will change.
The site has SEO work in it and we want to loose it minimum.Site is registered in Analytics and Webmaster Tools.
Google searches will end up blank pages and I don't want to loose my rank.
So I'm looking for a way to inform Google about new page URLs. Domain is same, only URLs. For example: the home page was /default.asp and now /home.aspx
Is there a way to tell Google that a particular URL address or page name has changed?
If all that is changing are the page URLs, Google Analytics cannot "know" that a page is the same, just with diferent URL.
But, you could apply a customized pageview using the _trackPageView() method, giving it the original url as parameter.
If you choose to do this, you will have to exclude the line that uses the method in the original GA code and apply it elsewhere, or pass the parameter to it directly with the orignial URL. All this is done in each page.
You can also read more about the method here.
For IIS (Asp.Net) you want to look into the following to find out how to do 301 redirects:
Response.RedirectPermanent(...) for redirecting from a page
or
"IIS 7 Routing Module and web.config" to set up bulk redirecting
I'd also suggest you consider supporting Search Engine Friendly (SEF) URLs while your making the move. The Routing Module can help you there as well.
You need to implement some form of 301 (301 is key) redirects. This way when google or any other search hits the old page, the index is refreshed with the new page. Asp.net allows you to do these redirects even at the IIS level, and where I'd suggest that they live. You'll also want to submit an up to date site map on webmaster tools.
Edit: Here's a good link on the redirects, http://www.iis.net/ConfigReference/system.webServer/httpRedirect

How to tell Google a page has moved?

We have #1 and #2 spots we would like to keep, but because of the way things were jumbled we have to migrate to a new domain.
We do not want the new domain to be penalized for duplicate content, we want it to naturally take the spot on Google.
How do we tell Google our page has moved?
301 redirects are the recommended way to do this according to Google themselves. I tend to perform 301's using a .htaccess file (a few different methods here) but it can also be done using PHP like this:
header('Location: '.$newlocation, true, 301)
What seengee user has answered is perfect.
Have a look to Google Webmaster Tools too; there's a specific option for Address change.
Change of address
If you're planning to move your site to a new domain, use the Change of Address tool to tell Google about your new URL. This will help us update our index faster and smooth the transition for your users.
For best results, follow these steps:
Set up the new site
Review our guidelines for moving your site to a new domain. Set up your content on your new domain, then make sure all internal links point to the new domain.
Redirect all traffic from the old site
Use a 301 redirect to permanently redirect the pages on your old site to your new site. This tells users and search engines that your site has permanently moved. Ask webmasters to update their links to point to your new domain and make sure incoming links to your old site are redirected correctly using the 301 redirects.
Add your new site to Webmaster Tools
Make sure you have added and verified your new domain.
Tell us the URL of your new domain
Try this: https://www.google.com/webmasters/tools add both domains there and then, go Change of address.
Http 301 Request is used for Permanent Redirect the old website's content,URL and Links to New Website URL. Google Never Penalize the New Website for Duplicate content.
what about "Keyword" you use in meta for performing in SERP result. After redirection how you manage them.
position before Redirection , after redirection have same OR not.
AS SEO purpose don't make Redirection withour proper plan. First make proper optimization of "B" page before "A" redirect ( 301, 302 ) "B" page.
Dont make 302 Redirect , its spammy after 3 months, why within 20 Days SERP catche show "B" page instead of "A" page.
in the end : Before Redirection - Optimize the Destination URl - for Benefit SEOand business
Have a Nice Day ... Thanks
Google itself detect your web page if you implemented the 301, 302 or 404 redirection. But if you want to tell google that you have moved your page then:
Go to google webmaster tool
In Crawl section there is an option of Fetch as Google.
Just enter your url and check the fetch status, you will find that google will index your new url.
in google webmaster tools click on change of site address.
firstly you need to put content on new website where you want to redirect the website.
redirect usingold website by using HTTP 301 code and after verify in google webmaster tools.
Do 301 redirects. This will tell the search engines that the pages have moved and where they are now. This also associates the old URL with the new URL for Google which means all of your old incoming links will now be redirects to your new pages. Also use Google Webmaster Tools to submit XML sitemap.
In both Google and Bing Webmaster tools, you can notify a change of address. I will warn you, however, that when changing domains, you're not going to keep your current rankings.
Submit a change of address notice in Webmaster tools
Do 1:1 page redirecting (redirect all other pages that can't be mapped to a similar page to your homepage)
Submit an up-to-date sitemap
This should help:
https://support.google.com/webmasters/answer/83106?hl=en
http://moz.com/blog/achieving-an-seo-friendly-domain-migration-the-infographic