473,769 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python style: to check or not to check args and data members

Hi!

The question of type checking/enforcing has bothered me for a while, and
since this newsgroup has a wealth of competence subscribed to it, I
figured this would be a great way of learning from the experts. I feel
there's a tradeoff between clear, easily readdable and extensible code
on one side, and safe code providing early errors and useful tracebacks
on the other. I want both! How do you guys do it? What's the pythonic
way? Are there any docs that I should read? All pointers and opinions
are appreciated!

I've also whipped up some examples in order to put the above questions
in context and for your amusement. :-)

Briefly:

class MyClass(object) :
def __init__(self, int_member = 0):
self.int_member = int_member
def process_data(se lf, data):
self.int_member += data

The attached files are elaborations on this theme, with increasing
security and, alas, rigidity and bloat. Even though
maximum_securit y_module.py probably will be the safest to use, the
coding style will bloat the code something awful and will probably make
maintenance harder (please prove me wrong!). Where should I draw the line?

These are the attached modules:

* nocheck_module. py:
As the above example, but with docs. No type checking.

* property_module .py
Type checking of data members using properties.

* methodcheck_mod ule.py
Type checking of args within methods.

* decorator_modul e.py
Type checking of args using method decorators.

* maximum_securit y_module.py
Decorator and property type checking.

Let's pretend I'm writing a script, I import one of the above modules
and then execute the following code

....
my_object = MyClass(data1)
my_object.proce ss_data(data2)

and then let's pretend dataX is of a bad type, say for example str.

nocheck_module. py
=============== ==
Now, if data2 is bad, we get a suboptimal traceback (possibly to
somewhere deep within the code, and probably with an unrelated error
message). However, the first point of failure will in fact be included
in the traceback, so this error should be possible to find with little
effort. On the other hand, if data1 is bad, the exception will be raised
somewhere past the point of first failure. The traceback will be
completely off, and the error message will still be bad. Even worse: if
both are bad, we won't even get an exception. We will trundle on with
corrupted data and take no notice. Very clear code, though. Easily
extensible.

property_module .py
=============== ===
Here we catch that data1 failure. Tracebacks may still be inconcise with
uninformative error messages, however they will not be as bad as in
nocheck_module. py. Bloat. +7 or more lines of boilerplate code for each
additional data member. Quite clear code. Readily extensible.

methodcheck_mod ule.py
=============== ======
Good, concise tracebacks with exact error messages. Lots of bloat and
obscured code. Misses errors where data members are changed directly.
Very hard to read and extend.

decorator_modul e.py
=============== ====
Good, concise tracebacks with good error messages. Some bloat. Misses
errors where data members are changed directly. Clear, but somewhat hard
to extend. Decorators for *all* methods?! This cannot be the purpose of
python!?

maximum_securit y_method.py
=============== ===========
Good, concise tracebacks with good error messages. No errors missed (I
think? :-) . Bloat. Lots of decorators and boilerplate property code all
over the place (thankfully not within functional code, though). Is this
how it's supposed to be done?
And if you've read all the way down here I thank you so very much for
your patience and perseverance. Now I'd like to hear your thoughts on
this! Where should the line be drawn? Should I just typecheck data from
unreliable sources (users/other applications) and stick with the
barebone strategy, or should I go all the way? Did I miss something
obvious? Should I read some docs? (Which?) Are there performance issues
to consider?

Thanks again for taking the time.

Cheers!
/Joel Hedlund

"""Example module without method argument type checking.

Pros:
Pinpointed tracebacks with very exact error messages.

Cons:
Lots of boilerplate typechecking code littered all over the place,
obscuring functionality at the start of every function.
Bloat will accumulate rapidly. +2 lines of boilerplate code per method and
argument.
If I at some point decide that floats are also ok, I'll need to crawl all
over the code with a magnifying glass and a pair of tweezers.
We don't catch errors of the type
a = MyClass()
a.int_member = 'moo!"
a.process_data( 1)

"""

class MyClass(object) :
"""My example class."""
def __init__(self, int_member = 0):
"""Instanti ate a new MyClass object.

IN:
int_member = 0: <int>
Set the value for the data member. Must be int.

"""
# Boilerplate typechecking code.
if not isinstance(int_ member, int):
raise TypeError("int_ member must be int")
# Initiallization starts here. May for example contain assignment.
self.int_member = int_member

def process_data(se lf, data):
"""Do some data processing.

IN:
data: <int>
New information that should be incorporated. Must be int.

"""
# Boilerplate typechecking code.
if not isinstance(data , int):
raise TypeError("data must be int")
# Data processing starts here. May for example contain addition:
self.int_member += data

# Test code. Decomment to play. :-)

#a = MyClass('moo')
#a = MyClass(9)
#a.int_member = 'moo'
#a.process_data ('moo')
#a.process_data (9)

"""Example module without type checking.

Pros:
Clean, easily readable and extensible code that gets down to business
fast. If I at some point decide that floats are also ok, I only need to
update the docs and all is well.
No bloat.

Cons:
Type restrictions are not enforced. This means that if type errors occur,
the exception may be raised far from the point of first failure, and
possibly with long, inconcise tracebacks with uninformative error messages.

"""

class MyClass(object) :
"""My example class."""
def __init__(self, int_member = 0):
"""Instanti ate a new MyClass object.

IN:
int_member = 0: <int>
Set the value for the data member. Must be int.

"""
# Initiallization starts here. May for example contain assignment.
self.int_member = int_member

def process_data(se lf, data):
"""Do some data processing.

IN:
data: <int>
New information that should be incorporated. Must be int.

"""
# Data processing starts here. May for example contain addition:
self.int_member += data

# Test code. Decomment to play. :-)

#a = MyClass('moo')
#a = MyClass(9)
#a.int_member = 'moo'
#a.process_data ('moo')
#a.process_data (9)

"""Example module using properties for data member type checking.

Pros:
Quite clean, readable and extensible code that gets down to business fast.
Data member type restrictions are enforced. If I at some point decide that
floats are also ok, I only need to update the docs and a few more lines.

Cons:
Method argument types are not enforced, which means that tracebacks may
still be inconcise with uninformative error messages. Not as bad as in
nocheck_module. py though.
Bloat. +7 or more lines of boilerplate code for each added data member (can
this be done neater?). But at least the bloat is outside functional code.

"""

class MyClass(object) :
"""My example class."""
def __init__(self, int_member = 0):
"""Instanti ate a new MyClass object.

IN:
int_member = 0: <int>
Set the value for the data member. Must be int.

"""
# Initiallization starts here. May for example contain assignment.
self.int_member = int_member

def _get_int_member (self):
return self.__int_memb er
def _set_int_member (self, value):
if not isinstance(valu e, int):
raise TypeError("int_ member must be type int")
self.__int_memb er = value
int_member = property(_get_i nt_member, _set_int_member )
del _get_int_member , _set_int_member

def process_data(se lf, data):
"""Do some data processing.

IN:
data: <int>
New information that should be incorporated. Must be int.

"""
# Data processing starts here. May for example contain addition:
self.int_member += data

# Test code. Decomment to play. :-)

#a = MyClass('moo')
#a = MyClass(9)
#a.int_member = 'moo'
#a.process_data ('moo')
#a.process_data (9)

"""Example module without type checking.

Pros:
Clean, easily readable and extensible code that gets down to business
fast.
Pinpointed tracebacks with good error messages.
If I at some point decide that floats are also ok, I only need to
update the docs and change the decorators to
@method_argtype s((int, float)).

Cons:
With many args and allowed types, the type definitions on the decorator
lines will be hard to correlate to the args that they refer to (probably
not impossible to workaround though...?).
We still don't catch errors of the type
a = MyClass()
a.int_member = 'moo!"
a.process_data( 1)
A decorator for each method everywhere? That can't be the purpose of
python!? There has to be a better way?!

"""

def method_argtypes (*typedefs):
"""Rudiment ary typechecker decorator generator.

If you're really interested in this stuff, go check out Michele
Simionato's decorator module instead. It rocks. Google is your friend.

IN:
*typedefs: <typeor <tuple <type>>
The allowed types for each arg to the method, self excluded.
Will be used with isinstance(), so valid typedefs include
int or (int, float).

"""
def argchecker(fcn) :
import inspect
names = inspect.getargs pec(fcn)[0][1:]
def check_args(*arg s):
for arg, value, allowed_types in zip(names, args[1:], typedefs):
if not isinstance(valu e, allowed_types):
one_of = ''
if hasattr(allowed _types, '__len__'):
one_of = "one of "
msg = ".%s() argument %r must be %s%s"
msg %= fcn.__name__, arg, one_of, allowed_types
raise TypeError(msg)
return fcn(*args)
return check_args
return argchecker

class MyClass(object) :
"""My example class."""
@method_argtype s(int)
def __init__(self, int_member = 0):
"""Instanti ate a new MyClass object.

IN:
int_member = 0: <int>
Set the value for the data member. Must be int.

"""
# Initiallization starts here. May for example contain assignment.
self.int_member = int_member

@method_argtype s(int)
def process_data(se lf, data):
"""Do some data processing.

IN:
data: <int>
New information that should be incorporated. Must be int.

"""
# Data processing starts here. May for example contain addition:
self.int_member += data

# Test code. Decomment to play. :-)

#a = MyClass('moo')
#a = MyClass(9)
#a.int_member = 'moo'
#a.process_data ('moo')
#a.process_data (9)

"""Example module without type checking.

Pros:
Clean, easily readable and extensible code that gets down to business
fast.
Pinpointed tracebacks with good error messages.
Now we catch errors of the type
a = MyClass()
a.int_member = 'moo!"
a.process_data( 1)

Cons:
With many args and allowed types, the type definitions on the decorator
lines will be hard to correlate to the args that they refer to (probably
not impossible to workaround though...?).
A decorator for each method everywhere? That can't be the purpose of
python!? There has to be a better way?!
Property bloat. +7 or more lines of boilerplate code for each added data
member (can this be done neater?).
If I at some point decide that floats are also ok, I only need to
update the docs, decorators and properties... hmm...

"""

def method_argtypes (*typedefs):
"""Rudiment ary typechecker decorator generator.

If you're really interested in this stuff, go check out Michele
Simionato's decorator module instead. It rocks. Google is your friend.

IN:
*typedefs: <typeor <tuple <type>>
The allowed types for each arg to the method, self excluded.
Will be used with isinstance(), so valid typedefs include
int or (int, float).

"""
def argchecker(fcn) :
import inspect
names = inspect.getargs pec(fcn)[0][1:]
def check_args(*arg s):
for arg, value, allowed_types in zip(names, args[1:], typedefs):
if not isinstance(valu e, allowed_types):
one_of = ''
if hasattr(allowed _types, '__len__'):
one_of = "one of "
msg = ".%s() argument %r must be %s%s"
msg %= fcn.__name__, arg, one_of, allowed_types
raise TypeError(msg)
return fcn(*args)
return check_args
return argchecker

class MyClass(object) :
"""My example class."""
@method_argtype s(int)
def __init__(self, int_member = 0):
"""Instanti ate a new MyClass object.

IN:
int_member = 0: <int>
Set the value for the data member. Must be int.

"""
# Initiallization starts here. May for example contain assignment.
self.int_member = int_member

def _get_int_member (self):
return self.__int_memb er
def _set_int_member (self, value):
if not isinstance(valu e, int):
raise TypeError("int_ member must be type int")
self.__int_memb er = value
int_member = property(_get_i nt_member, _set_int_member )
del _get_int_member , _set_int_member

@method_argtype s(int)
def process_data(se lf, data):
"""Do some data processing.

IN:
data: <int>
New information that should be incorporated. Must be int.

"""
# Data processing starts here. May for example contain addition:
self.int_member += data

# Test code. Decomment to play. :-)

#a = MyClass('moo')
#a = MyClass(9)
#a.int_member = 'moo'
#a.process_data ('moo')
#a.process_data (9)

Aug 31 '06
18 2756
I still wait for a
proof that it leads to more robust programs - FWIW, MVHO is that it
usually leads to more complex - hence potentially less robust - code.
MVHO? I assume you are not talking about Miami Valley Housing Opportunities
here, but bloat probably leads to bugs, yes.
Talking about interfaces, you may want to have a look at PyProtocols
(PEAK) and Zope3 Interfaces.
Ooh. Neat.
As long as you provide a usable documentation, misuse of your code is
not your problem anymore (unless of course you're the one misusing it !-).
But hey, then I'm still just letting idiots suffer from their idiocy, and
since that's part of our greater plan anyway I guess that's ok :-D
Then you probably want to read the relevant chapter in DiveIntoPython.
You are completely correct. Thanks for the tip.

Thanks for your help! It's been real useful. Now I'll sleep better at night.

Cheers!
/Joel
Sep 1 '06 #11
Joel Hedlund wrote:
>I still wait for a
proof that it leads to more robust programs - FWIW, MVHO is that it
usually leads to more complex - hence potentially less robust - code.

MVHO? I assume you are not talking about Miami Valley Housing
Opportunities here,
Nope --My Very Humble Opinion

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom. gro'.split('@')])"
Sep 1 '06 #12

Joel Hedlund wrote:
>
Hmmm... So. I should build grimly paranoid parsers for external data, use
duck-typed interfaces everywhere on the inside, and simply callously
disregard developers who are disinclined to read documentation? I could do that.
if you're really serious, unit tests is the way to go - they can check
for much more than just types.

Yes, I'm very much serious indeed. But I haven't done any unit testing. I'll
have to check into that. Thanks!
You might try doctests, they can be easier to write and fit into the
unit test framework if needed.
http://en.wikipedia.org/wiki/Doctest

- Paddy.

Sep 1 '06 #13
You might try doctests, they can be easier to write and fit into the
unit test framework if needed.
While I firmly believe in keeping docs up to date, I don't think that
doctests alone can solve the problem of maintaining data integrity in
projects with more comlex interfaces (which is what I really meant to
talk about. Sorry if my simplified examples led you to believe
otherwise). For simple, deterministic functions like math.pow I think
it's great, but for something like BaseHTTPServer. .. probably not. The
__doc__'s required would be truly fascinating to behold. And probably
voluminous and mostly unreadable for humans. Or is there something that
I've misunderstood?

/Joel
Sep 1 '06 #14

Joel Hedlund wrote:
You might try doctests, they can be easier to write and fit into the
unit test framework if needed.

While I firmly believe in keeping docs up to date, I don't think that
doctests alone can solve the problem of maintaining data integrity in
projects with more comlex interfaces (which is what I really meant to
talk about. Sorry if my simplified examples led you to believe
otherwise). For simple, deterministic functions like math.pow I think
it's great, but for something like BaseHTTPServer. .. probably not. The
__doc__'s required would be truly fascinating to behold. And probably
voluminous and mostly unreadable for humans. Or is there something that
I've misunderstood?

/Joel
Oh, I was just addressing your bit about not knowing unit tests.
Doctests can be quicker to put together and have only a small learning
curve.
On the larger scale, I too advocate extensive checking of 'tainted'
data from 'external' sources, then assuming 'clean' data is as expected
and doing no explicit further data checks, after all, you've got to
trust your development team/yourself.

- Pad.

Sep 1 '06 #15
Oh, I was just addressing your bit about not knowing unit tests.
Doctests can be quicker to put together and have only a small learning
curve.
OK, I see what you mean. And you're right. I'm struggling mightily right
now with trying to come up with sane unit tests for a bunch of
generalized parser classes that I'm about to implement, and which are
supposed to play nice with each other... Gah! But I'll get there
eventually... :-)
On the larger scale, I too advocate extensive checking of 'tainted'
data from 'external' sources, then assuming 'clean' data is as expected
and doing no explicit further data checks, after all, you've got to
trust your development team/yourself.
Right.

Thanks for helpful tips and insights, and for taking the time!

Cheers!
/Joel
Sep 2 '06 #16
Bruno Desthuilliers <on***@xiludom. growrites:
I've rarely encoutered "silent" data corruption with Python - FWIW, I
once had such a problem, but with a lower-level statically typed
language (integer overflow), and I was a very newbie programmer by that
time. Usually, one *very quickly* notices when something goes wrong.
The same thing can happen in Python, and the resulting bugs can be
pretty subtle. I noticed the following example as the result of
another thread, which was about how to sort an 85 gigabyte file.
Try to put a slice interface on a file-based object and you can
hit strange integer-overflow bugs once the file gets larger than 2GB:

Python 2.3.4 (#1, Feb 2 2005, 12:11:53)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
>>print slice(0, 3**33)
slice(0, 555906056655552 3L, None) # OK ...

So we expect slicing with large args to work properly. But then:
>>class A:
... def __getitem__(sel f, s):
... print s
...
>>a = A()
a[0:3**33]
slice(0, 2147483647, None) # oops!!!!
>>>
Sep 3 '06 #17
Paul Rubin a écrit :
Bruno Desthuilliers <on***@xiludom. growrites:
>>I've rarely encoutered "silent" data corruption with Python - FWIW, I
once had such a problem, but with a lower-level statically typed
language (integer overflow), and I was a very newbie programmer by that
time. Usually, one *very quickly* notices when something goes wrong.


The same thing can happen in Python, and the resulting bugs can be
pretty subtle. I noticed the following example as the result of
another thread, which was about how to sort an 85 gigabyte file.
Try to put a slice interface on a file-based object and you can
hit strange integer-overflow bugs once the file gets larger than 2GB:

Python 2.3.4 (#1, Feb 2 2005, 12:11:53)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
>>print slice(0, 3**33)
slice(0, 555906056655552 3L, None) # OK ...

So we expect slicing with large args to work properly. But then:
>>class A:
... def __getitem__(sel f, s):
... print s
...
>>a = A()
>>a[0:3**33]
slice(0, 2147483647, None) # oops!!!!
>>>
Looks like a Python bug, not a programmer error. And BTW, it doesn't
happens with >=2.4.1

Python 2.4.1 (#1, Jul 23 2005, 00:37:37)
[GCC 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)] on
linux2
Type "help", "copyright" , "credits" or "license" for more information.
>>print slice(0, 3**33)
slice(0, 555906056655552 3L, None)
>>class A(object):
.... def __getitem__(sel f, s):
.... print s
....
>>A()[0:3**33]
slice(0, 555906056655552 3L, None)
>>>
Sep 3 '06 #18
Jean-Paul Calderone <ex*****@divmod .comwrote:
...
>>class A(object):
note that A is new-style...
>class x:
....while x is old-style.

Here's a small script to explore the problem...:

import sys

class oldstyle:
def __getitem__(sel f, index): print index,

class newstyle(object , oldstyle): pass

s = slice(0, 3**33)

print sys.version[:5]
print 'slice:', s
print 'old:',
oldstyle()[s]
oldstyle()[:3**33]
print
print 'new:',
newstyle()[s]
newstyle()[:3**33]
print

Running this on 2.3.5, 2.4.3, 2.5c1, 2.6a0, the results are ALWAYS:

2.5c1
slice: slice(0, 555906056655552 3L, None)
old: slice(0, 555906056655552 3L, None) slice(0, 2147483647, None)
slice(None, 555906056655552 3L, 1)
new: slice(0, 555906056655552 3L, None) slice(None, 555906056655552 3L,
None) slice(None, 555906056655552 3L, 1)

[[except for the version ID, of course, which changes across runs;-)]]

So: no difference across Python releases -- bug systematically there
when slicing oldstyle classes, but only when slicing them with
NON-extended slice syntax (all is fine when slicing with extended syntax
OR when passing a slice object directly; indeed, dis.dis shows that
using extended syntax builds the slice then passes it, while slicing
without a step uses the SLICE+2 opcode instead).

If you add a (deprecated, I believe) __getslice__ method, you'll see the
same bug appear in newstyle classes too (again, for non-extended slicing
syntax only).

A look at ceval.c shows that apply_slice (called by SLICE+2 &c) uses
_PyEval_SliceIn dex and PySequence_GetS lice if the LHO has sq_slice in
tp_as_sequence, otherwise PySlice_New and PyObject_GetIte m. And the
relevant signature is...:

_PyEval_SliceIn dex(PyObject *v, Py_ssize_t *pi)

(int instead of Py_ssize_t in older versions of Python), so of course
the "detour" through this function MUST truncate the value (to 32 or 64
bits depending on the platform).

The reason the bug shows up in classic classes even without an explicit
__getslice__ is of course that a classic class ``has all the slots''
(from the C-level viewpoint;-) -- only way to allow the per-instance
behavior of classic-instances...
My inclination here would be to let the bug persist, just adding an
explanation of it in the documentation about why one should NOT use
classic classes and should NOT define __getslice__. Any fix might
perhaps provoke wrong behavior in old programs that define and use
__getslice__ and/or classic classes and "count" on the truncation; the
workaround is easy (only use fully-supported features of the language,
i.e. newstyle classes and __getitem__ for slicing). But I guess we can
(and probably should) move this debate to python-dev;-).
Alex
Sep 3 '06 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3670
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc. And i have things to offer, and to request. And a lot of ideas, but who needs them.... here's an example (from type_struct.py):
0
9422
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10208
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.