I'm want to delete Google Analytics filters at view level using Google App Script and Google Analytics management API.
I'm trying to run the following function:
function delete_filter() {
var delete = Analytics.Management.ProfileFilterLinks.delete('213755:84538578', '123456','12345678','UA-12345678-1');
}
but I have the following error:
TypeError: Analytics.Management.ProfileFilterLinks.delete is not a function
Does it means that the delete function is not available with Google App Script API?
How about this modification? At the official document, the "Profile Filter Links: delete" method is used. But at Advanced Google services, it seems that remove
is used. I think that the reason of your error message is due to this. So please modify as follows and testing it again.
var delete = Analytics.Management.ProfileFilterLinks.delete('213755:84538578', '123456','12345678','UA-12345678-1');
var delete = Analytics.Management.ProfileFilterLinks.remove(accountId, webPropertyId, profileId, linkId);
accountId, webPropertyId, profileId, linkId
are correct.