cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch camapigns clicks and the users clicked on particular urls.

Occasional Advisor

How to fetch camapigns clicks and the users clicked on particular urls.

Hi for reporting I want to fetch the clicks of particular URL in a particular camapign.

How we can fetch these things. In outh2 library there is no such function.

For open class having function :getCampaignOpens but there is no such function for clicks.

 

So alternatively I tried to use sampe form class file to fetch the clicks previously(1 month ago approx.) I was getting the result.

with these function getCampaignClicks($id) which is in CC_utility file. but now it's not responsding

The requested URL returned error: 403.

So can you please suggest how i can solve this and if possible can you implement such kind of functionality in the ConstantContact.php file of Oauth2.0

10 REPLIES 10
CTCT Employee

Re: How to fetch camapigns clicks and the users clicked on particular urls.

Hi,

 

I see what you mean--we don't have a getCampaignClicks function in the PHP wrapper.  DId you see that in one of our PHP wrapper previously?  We do have this function to query for clicks by contact, on line 150 of the main PHP wrapper.

 

public function getContactClicks(Contact $Contact, $page=null){
	$ContactsCollection = new ContactsCollection($this->CTCTRequest);
	$url = ($page) ? $this->CTCTRequest->baseUri.$page : $this->CTCTRequest->baseUri.$Contact->link.'/events/clicks';
	return $ContactsCollection->getContactEvents($url, 'ClickEvent');
}

I agree that we should have a get clicks by email campaign function, but we probably won't be able to add that in the very near future due to time constraints.  If you get campaign by ID, the clicks are in the XML that is returned, however.

 

Best Regards,

Shannon W.

API Support Specialist

Occasional Advisor

Re: How to fetch camapigns clicks and the users clicked on particular urls.

DId you see that in one of our PHP wrapper previously?


No, but we use that functionality in our Mailchimp integration. We just figured you guys would offer the same functionality. Basically, we need to be able to record the number of clicks, user who made clicks and the target of the click. This all gets added to the PSA software we use.

 

If we had to query each user individually, it would add a considerable amount of overhead that would be eliminated with the inclusion of a full campaign function. I'm not even sure the getContactClicks function would provide us with everything we need.

 

If you get campaign by ID, the clicks are in the XML that is returned, however.


Is this just the total number of clicks or does it contain other information?

CTCT Employee

Re: How to fetch camapigns clicks and the users clicked on particular urls.

Hi,

 

I see.  The Clicks returned associated with the campaign returns only the total number of clicks in the <Clicks> node.

 

Let me know if you have any other questions.

 

Best Regards,

Shannon W.

API Support Specialist

Occasional Advisor

Re: How to fetch camapigns clicks and the users clicked on particular urls.

Ah, that's not good. Is this functionality on your development roadmap? I'm sure plenty of people could make use of a feature like that. :)

CTCT Employee

Re: How to fetch camapigns clicks and the users clicked on particular urls.

Hi,

 

Yes, I see what you mean.  I will pass your feedback onto our product engineering team for you.

 

Best Regards,

Shannon W.

API Support Specialist

Occasional Advisor

Re: How to fetch camapigns clicks and the users clicked on particular urls.

But if you check out this repo which you people provided.

https://github.com/constantcontact/Constant-Contact-PHP-Sample-Contact-Forms

 

In this repo you will get a file name with cc_class.php in which there is a class CC_Campaign and in this class there is a function getCampaignClicks($id). i was just using this to fetch the clicks from a particular campaign for a particular url. Just one month ago it is working stage but now it's not giving me result.

So can you please look after that.

 

And if it's possible in near by future that any such API is available in near by future. That will be more appreciative if you apply this in Oauth2.0 as we are using these wrapper files in the Integration.

Occasional Advisor

Re: How to fetch camapigns clicks and the users clicked on particular urls.

Hi Shannon,

 

I just found that your repo file and the file I am having is little bit different. In your repo this function didn't exist. But the file I am having is having that function. 

On which Email Id I will sent that file so that you will get to know about my file.

Highlighted
CTCT Employee

Re: How to fetch camapigns clicks and the users clicked on particular urls.

Hi,

 

For that getCampaignClicks function, for ID, you want to pass in the ID of the contact you want to get campaign clicks for.  This is the same function I mentioned before.  It doesn't get campaign clicks by email (campaign); it retrieves clicks by the contact who clicked.  You would have to query each contact in the list(s) that the email was sent to, to make use of that function.

 

Update:  You can get the campaign clicks by calling a URI formatted as below:

 

https://api.constantcontact.com/ws/customers/{username}/campaigns/{campaign_id}/events/urls/{url_id}...

 

You can get the URL ID's for an email campaign by doing a GET to:

 

https://api.constantcontact.com/ws/customers/{username}/campaigns/{campaign_id}/events/urls

 

We don't have this functionality in any of our wrappers that I am aware of, however.  It would have to be built in.

 

Best Regards,

Shannon W.

API Support Specialist

Occasional Advisor

Re: How to fetch camapigns clicks and the users clicked on particular urls.

https://api.constantcontact.com/ws/customers/{username}/campaigns/{campaign_id}/events/urls/{url_id}

this is working but previously it was providing mein details of clicks from the object clickEvent

$clickscal->entry->content->ClickEvent->Contact

through this m getting clicks event. But now there is no such object found.

 

Also the alternate method you provided for get clicks from contact list

getContactClicks

in these function it's giving me result but not telling me that contact clicked which URL

so just add single array key like this

[events] => Array
(
[0] => CampaignEvent Object
(
[id] => http://api.constantcontact.com/ws/customers/{username}/events/clicks/{campaign_id},13,1350045105000
[title] => Click Event for Customer: {username}, Campaign: http://api.constantcontact.com/ws/customers/{username}/campaigns/{campaign_id}
[updated] => 2012-10-12T12:31:45.000Z
[contactId] => http://api.constantcontact.com/ws/customers/{username}/contacts/13
[emailAddress] => testing@gmail.com
[campaignId] => http://api.constantcontact.com/ws/customers/{username}/campaigns/{campaign_id}
[campaignName] => Email Created 2012/10/12, 7:59 AM
[campaignLink] => /ws/customers/{username}/campaigns/{campaign_id}
[eventTime] => 2012-10-12T12:31:45.000Z
)

)

[URL] = 'http://yourdomain.com/'

 

please provide me exact solution to fetch the click plus the URl which the user clicked.