from google analytics export I am trying to extract last number from the trafficSource.campaign field with next query:
SELECT
REGEXP_EXTRACT(trafficSource.campaign,r':(\d+$)') as campaign,
FROM
[95677969.ga_sessions_20160109] AS results,
WHERE
hits.type IN ('TRANSACTION','PAGE')
This Query works fine in UI and the number is returned by every row match the reg expresion, but when I copy paste this query in my script allways null value is returned.
trafficSource.campaign values are like this:
_dfa_107202:4637224:8531522
Please can anybody help me?