That code looks like it should work...
When I open a site on the WayBack Machine, the hostname is "web.archive.org.. there is no need to look at the referrer....
However, I am not seeing any Adobe, or Google Analytics being triggered from the archive at all... it's like all those executions of tracking are being removed by the Internet Archive... I check some other known sites using Adobe and I cannot see any tracking.. It's interesting that you have tracking showing up when other sites do not....
I know we used to see tracking for pages in the Internet Archive... perhaps this is a new behaviour...
What sample data are you working with on this?