0

1. I'm trying to push Landing Page using Measurement Protocol API with PHP Library. I am using these parameters

http://www.google-analytics.com/collect?payload_data&v=1&tid=ua-11111-1&cid=1734715495.1452625302&t=event&ec=category1&ea=action1&el=label1&ev=1&cn=campaign1&ck=keyword1&cs=google&cm=cpc&dl=http%3A%2F%2Fwww.example.com%2Flandingpage

Refering To this url

https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#dl

Value of dl parameter reflects on Screen Name instead Landing Page. I want to know how to override Landing Page data. Can anyone tell me?

2. If I provide dl parameter, Google Analytics does not override ck,cn (keyword and campaign name respectively) values. If I don't provide dl parameter it will override keyword and campaign name.

http://www.google-analytics.com/collect?payload_data&v=1&tid=ua-11111-1&cid=1734715495.1452625302&t=event&ec=category1&ea=action1&el=label1&ev=1&cn=campaign1&ck=keyword1&cs=google&cm=cpc

Please help me...

Thanks

Wasi
  • 50
  • 6
  • 1
    cd or Screen name is for application google analytics accounts and will only be displayed in an application Google Analytics account. Dl is document location or the webpage that the event was sent from and will display in a website google analytics account. CK and cn are for campaign tracking. The measurement protocol isn't going to over ride anything on you. Any values you want recorded you have to send. – Linda Lawton - DaImTo Jan 19 '16 at 13:57
  • First of all thank you for replying. When I'm sending dl, google analytics does not accepts keyword and campaign name. If I don't send dl parameter I can see keyword and campaign name in second dimension. Can you tell me how can I make dl,ck and cn being recorded in google analytics for a single Event? I want to see campaign, keyword and landing page as second dimension in Top Events report. – Wasi Jan 19 '16 at 14:27

2 Answers2

1

First comment not sure why you have payload_data& I have removed it in my requests.

If you send the request against the debugger

http://www.google-analytics.com/debug/collect?v=1&tid=UA-xxxxx-1&cid=1734715495.1452625302&t=event&ec=category1&ea=action1&el=label1&ev=1&cn=campaign1&ck=keyword1&cs=google&cm=cpc&dl=http//www.example.com/landingpage

It says that it is a valid request.

I tested it and with DL it logs the event and it logs the landing page in the real-time reports. I cant check if the campaign tracking logged until tomorrow it takes 24 hours for that data to show up in standard reports like Top Events. However documentation states that campaign tracking should be valid for all hit types so I don't see why it wouldn't be recording the key words. I will check tomorrow. If it doesn't show up I will let you know and contact Google.

Update:

I have data.

enter image description here

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
0

May be I was missing something, I just changed dl=urlencode($location) to dl=rawurlencode($location) and I changed 'cid' => "111111".rand(101, 9999); previously it was original captured value of _ga cookie of some particular session like 1734715495.1452625302

Secondly dl value is still going to Screen Name dimension in Google Analytics report. I want to view it as Landing Page, what parameter should I use?

AgeDeO
  • 3,137
  • 2
  • 25
  • 57
Wasi
  • 50
  • 6
  • if you are seeing screen name in your google analytics account I think you have an application google analytics account you are not going to see DL. that's for web accounts. – Linda Lawton - DaImTo Jan 20 '16 at 14:01