My company uses short URLs for marketing campaigns, which redirect to URLs with tracking. For example:
example.com/campaign
will redirect to:
example.com/utm_source=one&utm_medium=two&utm_term=three&utm_content=four&utm_campaign=five
I have an excel file with a list of short URLs, but the tracking URLs are not listed. The current process is to manually open each link and copy the URL.
Is there a way to copy the tracking URLs into excel using VBA?
So far I've explored the following:
Dim ie As Object
Set ie = CreateObject("Internetexplorer.Application")
ie.Navigate Cells(1, 1)
But I can't find a way to then copy the new URL back into excel.
I've also tried:
Dim link As Hyperlink
Cells(1, 1).Select
Set link = ActiveSheet.Hyperlinks.Add(Anchor:=Cells(1, 1), Address:=Cells(1, 1))
link.Follow
Cells(1, 2) = link.Address
However this just (unsurprisingly) brings back the original hyperlink.
How can I bring back the tracking URL? Ideally without having to install any other software (as my company's IT department is a nightmare) but if that's the only option then so be it.