AdWords
6K members online now
6K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Tracking External URL using 301 redirect and .htaccess

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

(All links are fictitious) I would like to track an ad in Google Analytics we are running on a billboard. The URL on the billboard is domain.com/billboard. I used the following 301 redirect in htaccess

 

redirect 301 /billboard/ http://domain.com/billboard?utm_source=miami_downtown&utm_medium=billboard&utm_campaign=301_redirect...

 

I want the client to land on domain.com/billboard/ and not be redirected to any other URL.

 

Question:  Can I redirect same page/ folder to the same page/ folder with the tracking parameters?

 

Or... do I have to create a separate URL for the landing page (for example, domain.com/billboard-miami/)?  Then, whoever lands on domain.com/billboard will be redirected to domain.com/billboard-miami.  I prefer to keep it clean using domain.com/billboard/ and use ad tracking parameters in Google Analytics, if possible.  Thank you for your help.

 

Sebastian

 

 

1 Expert replyverified_user

Tracking External URL using 301 redirect and .htaccess

Top Contributor
# 2
Top Contributor

Hi Sebastian,

I'm not sure what you are trying to accomplish with this. Do you want to show different content depending on the value of utm_source?

What's not making sense here is the redirect will take all visits to /billboard/ to the same content. It seems a better method would be manual tagging of your ads and keyword level URL's. That way you can change the utm_source with the manual tagging and show custom content depending on that value.

The way you have it set up, everyone sees the same content and everyone has the same utm_* values.

You can also manually tag your external links in social media and such.

Best of Luck!

 

Pete

 

petebardo -- Deadhead doing AdWords

Tracking External URL using 301 redirect and .htaccess

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thanks, Pete for the info. All I wanted to accomplish here is track the sessions in Analytics. I wanted to see how many visitors the ad received (Analytics - Acquisition - Source/Medium). Nothing else.  I have a similar redirect from exampledomain.com to domain.com and it works but not for domain.com/billboard/ to domain.com/billboard/ with tracking parameters.  

 

I thought this was the easiest method to implement to find out the number of sessions/ visits for the billboard. 

 

Thanks,


Sebastian

 

 

Tracking External URL using 301 redirect and .htaccess

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

BTW the domain.com/billboard/ is a landing page for a billboard downtown Miami, so all visitors will land on that page. I did not want to use Google Tag Manager for tracking in this case.  I thought using 301 redirect and custom URL tracking code would still give our client the number of visitors that came to the site using domain.com/billboard/ link.

 

Thanks.

Tracking External URL using 301 redirect and .htaccess

Top Contributor
# 5
Top Contributor

Hi Sebastian S,

Oh, I see what you are trying to do.

I'm not very good with .htaccess. I tried this, redirecting to the same page adding a query string. Either the browser or the server complained that it was a recursive redirect and would never complete.

Seems like redirecting to the same page might not be a good idea.

As I said, I might not be the right guy to answer your question.

 

Pete

 

petebardo -- Deadhead doing AdWords

Tracking External URL using 301 redirect and .htaccess

Collaborator ✭ ☆ ☆
# 6
Collaborator ✭ ☆ ☆

@Sebastian S

 

This is my cup of tea.  As @petebardo pointed out, what you are trying to do is recursive. It would loop infinitely. URL parameters are just that, parameters.  redirect 301 /billboard/ would behave the same way with any kind of parameter, including the one you are trying to "redirect" to.

I totally get what you are trying to do here, and I believe the easiest solution would be to drill down the /billboard/ traffic in Analytics.  You'll find it in the Behavior --> Site Content --> Content drilldown