1

Is there a way to (in Javascript+jQuery), extract the data of whether a visitor is Paid vs. Organic traffic (or other such metrics)?

For the scope of the question, you can assume that Universal Analytics is running on the landingpage, but I'm limited to console-level Javascript only.

Little background: For a test we want to run, we're looking to target different visitors in different ways in a sort of tag manager-tool. The tool limits us to only using Javascript, so we can not directly use the information from Analytics.

I've seen this question. However, that question appears to be outdated, because (as is written in the comments of the answer), the answer does not work with UA.

This information is available in Analytics, so you'd think they'd be able to retrieve it from somewhere. My question is, could I find this information through Javascript?

Community
  • 1
  • 1
Davy
  • 691
  • 1
  • 7
  • 18

1 Answers1

0

You can identify the traffic on the landingpage, since with UA paid traffic either needs to have a gclid (a Google click id from Google Adwords) or campaign parameters ("utm parameters", most notably utm_campaign) that identify if this is a paid channel. Then you'd have to store the information via a cookie or localstorage.

Other than that the Universal Analytics tracking code will not reveal anything about the visitor except the client id, which says nothing about paid vs. organic.

For completeness sake: In theory you could store client ids as a custom dimension in GA and use the API to create a service that let's you retrieve information about a given client id via an ajax call, but that would have a certain lag (since GA needs a few hours before it has processed data for a visit), would probably not be very efficient and might have privacy implications that might put you at odds with the Google TOS and national laws.

Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62
  • Hmm, so if its not paid then consider it organic? Couldn't there be other sources, like if they manually typed it in with a business card, or offline flyer? – SSH This Aug 15 '17 at 16:39